Skip to content

Commit

Permalink
Redesign the features
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Aug 9, 2024
1 parent f28f852 commit 48d4f4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ keywords = ["beta", "error", "gamma"]

[features]
default = ["no_std"]
no_std = []
no_std = ["lambert_w/libm"]
std = ["lambert_w/std"]

[dependencies]
lambert_w = { version = "0.5.2", default-features = false, features = ["50bits", "libm"] }
lambert_w = { version = "0.5.2", default-features = false, features = ["50bits"] }
libm = "0.2"

[dev-dependencies]
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ all: check test

.PHONY: test
bench:
cargo +nightly bench
cargo +nightly bench --no-default-features
cargo +nightly bench --no-default-features --features no_std
cargo +nightly bench --no-default-features --features std

.PHONY: check
check:
cargo clippy -- -D warnings
cargo clippy --no-default-features -- -D warnings
cargo clippy --no-default-features --features no_std -- -D warnings
cargo clippy --no-default-features --features std -- -D warnings
cargo fmt --all -- --check

.PHONY: test
test:
cargo test
cargo test --no-default-features
cargo test --no-default-features --features no_std
cargo test --no-default-features --features std
8 changes: 6 additions & 2 deletions src/primitive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ macro_rules! implement {
}
}

#[cfg_attr(feature = "no_std", path = "extrinsic.rs")]
#[cfg_attr(not(feature = "no_std"), path = "intrinsic.rs")]
#[cfg(feature = "no_std")]
#[path = "extrinsic.rs"]
mod implementation;

#[cfg(feature = "std")]
#[path = "intrinsic.rs"]
mod implementation;

pub use implementation::Primitive;

0 comments on commit 48d4f4c

Please sign in to comment.