Skip to content

Rust port includes dependency even with std #179

Description

@Romacat2

According to my observations, features "std" includes num-traits as a dependency

[features]
default = ["std"]
f64 = []
std = ["num-traits/std"]
libm = ["num-traits/libm"]

although in the code lib.rs:

// Use the `num-traits` crate's `Float` trait if the user has enabled the `libm` feature flag
#[cfg(feature = "libm")]
use num_traits::float::Float as FloatOps;

// Use the standard library's `f32` type for floating point math operators if we're in an `std` (not `no_std`) context and the user hasn't enabled the `libm` feature flag
#[cfg(all(feature = "std", not(feature = "libm")))]
use f32 as FloatOps;

num-traits is only used with the libm feature, as mentioned on the crates.io page.
To fix this problem, you need to replace

std = ["num-traits/std"]

with

std = [] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions