Allows you to remove the minecraft-data at compile time

pull/6/head
Wyatt Herkamp 2 years ago
parent b6507aae16
commit c63cd1f11a

@ -15,6 +15,11 @@ thiserror = "1.0.31"
serde_json = "1.0.81" serde_json = "1.0.81"
serde_derive = "1.0.137" serde_derive = "1.0.137"
serde = "1.0.137" serde = "1.0.137"
include_dir = "0.7.2" include_dir = { version = "0.7.2", optional = true }
itertools = "0.10.3" itertools = { version = "0.10.3", optional = true }
lazy_static = "1.4.0" lazy_static = { version = "1.4.0", optional = true }
[features]
default = ["include_data"]
include_data = ["include_dir", "itertools", "lazy_static"]

@ -4,6 +4,11 @@ This repository is a rust library to access minecraft data.
The data itself hosted in the [minecraft-data](https://github.com/PrismarineJS/minecraft-data) repository The data itself hosted in the [minecraft-data](https://github.com/PrismarineJS/minecraft-data) repository
and included into the library at compile time. and included into the library at compile time.
### Excluding the minecraft-data at compile time
By adding `default-features=false` to the dependency in your `Cargo.toml` file, you can exclude the minecraft-data from the library.
## Usage ## Usage
```rust ```rust

@ -4,12 +4,15 @@
extern crate serde_derive; extern crate serde_derive;
/// Provides data access methods /// Provides data access methods
#[cfg(feature="include_data")]
pub mod api; pub mod api;
#[cfg(feature="include_data")]
pub(crate) mod data; pub(crate) mod data;
/// Contains the type definitions for the data /// Contains the type definitions for the data
pub mod models; pub mod models;
pub(crate) mod utils; pub(crate) mod utils;
#[cfg(feature="include_data")]
pub use api::Api; pub use api::Api;
pub use utils::error::DataError; pub use utils::error::DataError;
pub use utils::error::DataResult; pub use utils::error::DataResult;

Loading…
Cancel
Save