Skip to content

Commit 58dad2c

Browse files
bors[bot]vkahlValentin Kahl
authored
Merge #56
56: Make Float work with no_std (rebased #50) r=cuviper a=cuviper - Use ::core::num::FpCategory when deriving Float to work with no_std - Get rid of unnecessary double-borrowing to fix clippy lint Co-authored-by: vkahl <[email protected]> Co-authored-by: Valentin Kahl <[email protected]>
2 parents fce481d + aef0b5e commit 58dad2c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl NumTraits {
193193
if self.explicit {
194194
output
195195
} else {
196-
dummy_const_trick(trait_, &name, output)
196+
dummy_const_trick(trait_, name, output)
197197
}
198198
}
199199
}
@@ -369,7 +369,7 @@ pub fn from_primitive(input: TokenStream) -> TokenStream {
369369
}
370370
};
371371

372-
import.wrap("FromPrimitive", &name, impl_).into()
372+
import.wrap("FromPrimitive", name, impl_).into()
373373
}
374374

375375
/// Derives [`num_traits::ToPrimitive`][to] for simple enums and newtypes.
@@ -544,7 +544,7 @@ pub fn to_primitive(input: TokenStream) -> TokenStream {
544544
}
545545
};
546546

547-
import.wrap("ToPrimitive", &name, impl_).into()
547+
import.wrap("ToPrimitive", name, impl_).into()
548548
}
549549

550550
const NEWTYPE_ONLY: &str = "This trait can only be derived for newtypes";
@@ -623,7 +623,7 @@ pub fn num_cast(input: TokenStream) -> TokenStream {
623623
}
624624
};
625625

626-
import.wrap("NumCast", &name, impl_).into()
626+
import.wrap("NumCast", name, impl_).into()
627627
}
628628

629629
/// Derives [`num_traits::Zero`][zero] for newtypes. The inner type must already implement `Zero`.
@@ -650,7 +650,7 @@ pub fn zero(input: TokenStream) -> TokenStream {
650650
}
651651
};
652652

653-
import.wrap("Zero", &name, impl_).into()
653+
import.wrap("Zero", name, impl_).into()
654654
}
655655

656656
/// Derives [`num_traits::One`][one] for newtypes. The inner type must already implement `One`.
@@ -677,7 +677,7 @@ pub fn one(input: TokenStream) -> TokenStream {
677677
}
678678
};
679679

680-
import.wrap("One", &name, impl_).into()
680+
import.wrap("One", name, impl_).into()
681681
}
682682

683683
/// Derives [`num_traits::Num`][num] for newtypes. The inner type must already implement `Num`.
@@ -701,7 +701,7 @@ pub fn num(input: TokenStream) -> TokenStream {
701701
}
702702
};
703703

704-
import.wrap("Num", &name, impl_).into()
704+
import.wrap("Num", name, impl_).into()
705705
}
706706

707707
/// Derives [`num_traits::Float`][float] for newtypes. The inner type must already implement
@@ -763,7 +763,7 @@ pub fn float(input: TokenStream) -> TokenStream {
763763
<#inner_ty as #import::Float>::is_normal(self.0)
764764
}
765765
#[inline]
766-
fn classify(self) -> ::std::num::FpCategory {
766+
fn classify(self) -> ::core::num::FpCategory {
767767
<#inner_ty as #import::Float>::classify(self.0)
768768
}
769769
#[inline]
@@ -950,5 +950,5 @@ pub fn float(input: TokenStream) -> TokenStream {
950950
}
951951
};
952952

953-
import.wrap("Float", &name, impl_).into()
953+
import.wrap("Float", name, impl_).into()
954954
}

0 commit comments

Comments
 (0)