bevy/crates/bevy_asset/src
thepackett 182c21dc58
AssetPath source parse fix (#11543)
# Objective


Fixes #11533 


When `AssetPath`s are created from a string type, they are parsed into
an `AssetSource`, a `Path`, and a `Label`.
The current method of parsing has some unnecessary quirks:

- The presence of a `:` character is assumed to be the start of an asset
source indicator.
- This is not necessarily true. There are valid uses of a `:` character
in an asset path, for example an http source's port such as
`localhost:80`.
- If there are multiple instances of `://`, the last one is assumed to
be the asset source deliminator.
- This has some unexpected behavior. Even in a fully formed path, such
as `http://localhost:80`, the `:` between `localhost` and `80` is
assumed to be the start of an asset source, causing an error since it
does not form the full sequence `://`.


## Solution
Changes the `AssetPath`'s `parse_internal` method to be more permissive.
- Only the exact sequence `://` is taken to be the asset source
deliminator, and only the first one if there are multiple.
- As a consequence, it is no longer possible to detect a malformed asset
source deliminator, and so the corresponding error was removed.
2024-01-26 21:23:06 +00:00
..
io Fix documentation for AssetReader::is_directory function (#11538) 2024-01-26 13:55:36 +00:00
processor AssetSaver and AssetTransformer split (#11260) 2024-01-26 20:20:58 +00:00
server Fix minor typo (#11491) 2024-01-23 21:00:57 +00:00
assets.rs Remove TypeUuid (#11497) 2024-01-25 16:16:58 +00:00
event.rs Added AssetLoadFailedEvent, UntypedAssetLoadFailedEvent (#11369) 2024-01-17 21:12:00 +00:00
folder.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
handle.rs Remove TypeUuid (#11497) 2024-01-25 16:16:58 +00:00
id.rs Remove TypeUuid (#11497) 2024-01-25 16:16:58 +00:00
lib.rs AssetSaver and AssetTransformer split (#11260) 2024-01-26 20:20:58 +00:00
loader.rs AssetSaver and AssetTransformer split (#11260) 2024-01-26 20:20:58 +00:00
meta.rs Reorder impl to be the same as the trait (#11076) 2023-12-24 17:43:55 +00:00
path.rs AssetPath source parse fix (#11543) 2024-01-26 21:23:06 +00:00
reflect.rs Replace or document ignored doctests (#11040) 2024-01-01 16:50:56 +00:00
saver.rs Make AssetLoader/Saver Error type bounds compatible with anyhow::Error (#10493) 2023-11-14 01:25:06 +00:00
transformer.rs AssetSaver and AssetTransformer split (#11260) 2024-01-26 20:20:58 +00:00