Skip to content

Commit

Permalink
utils - f64 - use num-traits when std is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
elpiel committed Aug 12, 2022
1 parent e267af5 commit 931a615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ chrono = { version = "0.4.19", default-features = false }
arrayvec = { version = "0.7.2", default-features = false }
heapless = "0.7.15"

# we include num-traits only when `std` is not enabled
# because of `fract()` and `trunc()` methods
num-traits = { version = "0.2", default-features = false }

[dev-dependencies]
quickcheck = { version = "1.0.3", default-features = false }
approx = "0.5.1"
Expand Down
3 changes: 3 additions & 0 deletions src/sentences/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use nom::combinator::{map, map_parser, map_res};
use nom::number::complete::double;
use nom::sequence::tuple;
use nom::IResult;
#[cfg(not(feature = "std"))]
#[allow(unused_imports)]
use num_traits::float::FloatCore;

pub(crate) fn parse_hms(i: &[u8]) -> IResult<&[u8], NaiveTime> {
map_res(
Expand Down

0 comments on commit 931a615

Please sign in to comment.