diff --git a/Cargo.toml b/Cargo.toml index a841374..932fff8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_embedded_assets" -version = "0.9.1" +version = "0.10.0" authors = ["François Mockers "] edition = "2021" license = "MIT OR Apache-2.0" @@ -18,7 +18,7 @@ default = ["default-source"] default-source = ["futures-io", "futures-lite"] [dependencies.bevy] -version = "0.12" +version = "0.13" default-features = false features = ["bevy_asset"] diff --git a/README.md b/README.md index 4f7bfd0..37b521f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ fn main() { |Bevy|bevy_embedded_assets| |---|---| |main|main| +|0.13|0.10| |0.12|0.9| |0.11|0.8| |0.10|0.7| diff --git a/src/asset_reader.rs b/src/asset_reader.rs index d36eed5..82f7326 100644 --- a/src/asset_reader.rs +++ b/src/asset_reader.rs @@ -17,15 +17,15 @@ use crate::{include_all_assets, EmbeddedRegistry}; /// Struct which can be used to retrieve embedded assets directly /// without the normal Bevy `Handle` approach. This is useful /// for cases where you need an asset outside the Bevy ECS environment. -/// +/// /// This is only available when the `default-source` cargo feature is enabled. -/// +/// /// Example usage is below which assumes you have an asset named `image.png` /// in your `assets` folder (which this crate embeds at compile time). /// ```rust -/// use bevy_embedded_assets::EmbeddedAssetReader; +/// use bevy_embedded_assets::{DataReader, EmbeddedAssetReader}; /// use std::path::Path; -/// +/// /// fn some_bevy_system() { /// let embedded: EmbeddedAssetReader = EmbeddedAssetReader::preloaded(); /// let reader: DataReader = embedded.load_path_sync(&Path::new("image.png")).unwrap(); @@ -33,6 +33,7 @@ use crate::{include_all_assets, EmbeddedRegistry}; /// // Do what you need with the data /// } /// ``` +#[allow(clippy::module_name_repetitions)] pub struct EmbeddedAssetReader { loaded: HashMap<&'static Path, &'static [u8]>, fallback: Option>, @@ -68,7 +69,7 @@ impl EmbeddedAssetReader { } /// Create an [`EmbeddedAssetReader`] loaded with all the assets found by the build script. - /// + /// /// This ensures the [`EmbeddedAssetReader`] has all (embedded) assets loaded and can be used /// directly without the typical Bevy `Handle` approach. Retrieve assets directly after /// calling `preloaded` with [`EmbeddedAssetReader::load_path_sync()`]. @@ -140,7 +141,7 @@ impl EmbeddedAssetReader { /// A wrapper around the raw bytes of an asset. /// This is returned by [`EmbeddedAssetReader::load_path_sync()`]. -/// +/// /// To get the raw data, use `reader.0`. #[derive(Default, Debug, Clone, Copy)] pub struct DataReader(pub &'static [u8]); diff --git a/src/lib.rs b/src/lib.rs index b4191ed..4d7d49b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,9 +27,9 @@ use bevy::{ #[cfg(feature = "default-source")] mod asset_reader; #[cfg(feature = "default-source")] -pub use asset_reader::EmbeddedAssetReader; -#[cfg(feature = "default-source")] pub use asset_reader::DataReader; +#[cfg(feature = "default-source")] +pub use asset_reader::EmbeddedAssetReader; include!(concat!(env!("OUT_DIR"), "/include_all_assets.rs"));