use RonLoader as LocalizationFragment's loader directly

This commit is contained in:
Vincent Foulon 2020-12-28 23:53:26 +01:00
parent bb7cc3d53b
commit 2b6b2fd12e

View File

@ -160,7 +160,7 @@ impl assets::Asset for Localization {
const EXTENSION: &'static str = "ron";
}
impl assets::Asset for LocalizationFragment {
type Loader = LocalizationLoader;
type Loader = assets::RonLoader;
const EXTENSION: &'static str = "ron";
}
@ -186,12 +186,6 @@ impl assets::Loader<Localization> for LocalizationLoader {
Ok(asked_localization)
}
}
impl assets::Loader<LocalizationFragment> for LocalizationLoader {
fn load(content: Cow<[u8]>, ext: &str) -> Result<LocalizationFragment, assets::BoxedError> {
let asked_fragment: LocalizationFragment = assets::RonLoader::load(content, ext)?;
Ok(asked_fragment)
}
}
/// Initializes and return a Localization with the given key
pub fn init_localization(asset_key: &str) -> Result<Localization, assets::BoxedError> {