Skip to content

Commit

Permalink
subscriber: use f64 consts as module imports
Browse files Browse the repository at this point in the history
This fixes the build on Rust 1.42.0, where primitive types don't have
associated consts. My bad!
  • Loading branch information
hawkw committed Sep 19, 2021
1 parent 178e553 commit 27a2ce9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tracing-subscriber/src/filter/env/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl fmt::Display for ValueMatch {
match self {
ValueMatch::Bool(ref inner) => fmt::Display::fmt(inner, f),
ValueMatch::F64(ref inner) => fmt::Display::fmt(inner, f),
ValueMatch::NaN => fmt::Display::fmt(&f64::NAN, f),
ValueMatch::NaN => fmt::Display::fmt(&std::f64::NAN, f),
ValueMatch::I64(ref inner) => fmt::Display::fmt(inner, f),
ValueMatch::U64(ref inner) => fmt::Display::fmt(inner, f),
ValueMatch::Pat(ref inner) => fmt::Display::fmt(inner, f),
Expand Down Expand Up @@ -355,7 +355,9 @@ impl<'a> Visit for MatchVisitor<'a> {
Some((ValueMatch::NaN, ref matched)) if value.is_nan() => {
matched.store(true, Release);
}
Some((ValueMatch::F64(ref e), ref matched)) if (value - *e).abs() < f64::EPSILON => {
Some((ValueMatch::F64(ref e), ref matched))
if (value - *e).abs() < std::f64::EPSILON =>
{
matched.store(true, Release);
}
_ => {}
Expand Down

0 comments on commit 27a2ce9

Please sign in to comment.