Skip to content

Commit

Permalink
make num-traits-dependency implicit by re-exporting it from the inter…
Browse files Browse the repository at this point in the history
…nal diman module
  • Loading branch information
Tehforsch committed Jan 16, 2024
1 parent 678f452 commit 567bbdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/diman_unit_system/src/codegen/float_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ impl Codegen {
fn ensure_float_traits(&self) -> TokenStream {
if cfg!(feature = "num-traits-libm") {
quote! {
use num_traits::float::Float;
use diman::internal::Float;
}
} else {
quote! {
use num_traits::float::FloatCore;
use diman::internal::FloatCore;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,8 @@ pub mod internal {
pub use diman_lib::dimension_exponent::DimensionExponent;
pub use diman_lib::ratio::Ratio;
pub use diman_lib::runtime_unit_storage;
#[cfg(feature = "num-traits-libm")]
pub use num_traits::float::Float;
#[cfg(not(feature = "num-traits-libm"))]
pub use num_traits::float::FloatCore;
}

0 comments on commit 567bbdf

Please sign in to comment.