mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Misc asset code quality and docs (#13382)
* Fix a doc comment for AssetSources * Move some complicated generics to a where clause and write out T -> Transformer fully
This commit is contained in:
parent
f91fd322b7
commit
debcf3fb1d
2 changed files with 10 additions and 8 deletions
|
@ -525,7 +525,7 @@ impl AssetSource {
|
|||
}
|
||||
}
|
||||
|
||||
/// A collection of [`AssetSources`].
|
||||
/// A collection of [`AssetSource`]s.
|
||||
pub struct AssetSources {
|
||||
sources: HashMap<CowArc<'static, str>, AssetSource>,
|
||||
default: AssetSource,
|
||||
|
|
|
@ -167,13 +167,14 @@ pub enum ProcessError {
|
|||
ExtensionRequired,
|
||||
}
|
||||
|
||||
impl<
|
||||
Loader: AssetLoader,
|
||||
T: AssetTransformer<AssetInput = Loader::Asset>,
|
||||
Saver: AssetSaver<Asset = T::AssetOutput>,
|
||||
> Process for LoadTransformAndSave<Loader, T, Saver>
|
||||
impl<Loader, Transformer, Saver> Process for LoadTransformAndSave<Loader, Transformer, Saver>
|
||||
where
|
||||
Loader: AssetLoader,
|
||||
Transformer: AssetTransformer<AssetInput = Loader::Asset>,
|
||||
Saver: AssetSaver<Asset = Transformer::AssetOutput>,
|
||||
{
|
||||
type Settings = LoadTransformAndSaveSettings<Loader::Settings, T::Settings, Saver::Settings>;
|
||||
type Settings =
|
||||
LoadTransformAndSaveSettings<Loader::Settings, Transformer::Settings, Saver::Settings>;
|
||||
type OutputLoader = Saver::OutputLoader;
|
||||
|
||||
async fn process<'a>(
|
||||
|
@ -200,7 +201,8 @@ impl<
|
|||
.await
|
||||
.map_err(|err| ProcessError::AssetTransformError(err.into()))?;
|
||||
|
||||
let saved_asset = SavedAsset::<T::AssetOutput>::from_transformed(&post_transformed_asset);
|
||||
let saved_asset =
|
||||
SavedAsset::<Transformer::AssetOutput>::from_transformed(&post_transformed_asset);
|
||||
|
||||
let output_settings = self
|
||||
.saver
|
||||
|
|
Loading…
Reference in a new issue