mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix doc test
Former-commit-id: e347ad79dd229d72f70820189e6ae6011868c5ef
This commit is contained in:
@ -37,11 +37,11 @@ lazy_static! {
|
|||||||
/// Function used to load assets
|
/// Function used to load assets
|
||||||
/// loaded assets are cached in a global singleton hashmap
|
/// loaded assets are cached in a global singleton hashmap
|
||||||
/// Example usage:
|
/// Example usage:
|
||||||
/// ```
|
/// ```no_run
|
||||||
/// use image::DynamicImage;
|
/// use image::DynamicImage;
|
||||||
/// use common::assets;
|
/// use veloren_common::assets;
|
||||||
///
|
///
|
||||||
/// let my_image = Assets::load::<DynamicImage>("core.ui.backgrounds.city").unwrap();
|
/// let my_image = assets::load::<DynamicImage>("core.ui.backgrounds.city").unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
pub fn load<A: Asset + 'static>(specifier: &str) -> Result<Arc<A>, Error> {
|
pub fn load<A: Asset + 'static>(specifier: &str) -> Result<Arc<A>, Error> {
|
||||||
Ok(ASSETS
|
Ok(ASSETS
|
||||||
@ -57,11 +57,11 @@ pub fn load<A: Asset + 'static>(specifier: &str) -> Result<Arc<A>, Error> {
|
|||||||
/// Use this to load essential assets
|
/// Use this to load essential assets
|
||||||
/// loaded assets are cached in a global singleton hashmap
|
/// loaded assets are cached in a global singleton hashmap
|
||||||
/// Example usage:
|
/// Example usage:
|
||||||
/// ```
|
/// ```no_run
|
||||||
/// use image::DynamicImage;
|
/// use image::DynamicImage;
|
||||||
/// use common::assets;
|
/// use veloren_common::assets;
|
||||||
///
|
///
|
||||||
/// let my_image = Assets::load_expect::<DynamicImage>("core.ui.backgrounds.city");
|
/// let my_image = assets::load_expect::<DynamicImage>("core.ui.backgrounds.city");
|
||||||
/// ```
|
/// ```
|
||||||
pub fn load_expect<A: Asset + 'static>(specifier: &str) -> Arc<A> {
|
pub fn load_expect<A: Asset + 'static>(specifier: &str) -> Arc<A> {
|
||||||
load(specifier).expect(&format!("Failed loading essential asset: {}", specifier))
|
load(specifier).expect(&format!("Failed loading essential asset: {}", specifier))
|
||||||
|
Reference in New Issue
Block a user