Преглед на файлове

Remove useless extern crate

Josh Stone преди 3 години
родител
ревизия
1010ba920d
променени са 2 файла, в които са добавени 3 реда и са изтрити 9 реда
  1. 2 4
      src/lib.rs
  2. 1 5
      tests/cast.rs

+ 2 - 4
src/lib.rs

@@ -17,13 +17,11 @@
 #![doc(html_root_url = "https://docs.rs/num-traits/0.2")]
 #![deny(unconditional_recursion)]
 #![no_std]
+
+// Need to explicitly bring the crate in for inherent float methods
 #[cfg(feature = "std")]
 extern crate std;
 
-// Only `no_std` builds actually use `libm`.
-#[cfg(all(not(feature = "std"), feature = "libm"))]
-extern crate libm;
-
 use core::fmt;
 use core::num::Wrapping;
 use core::ops::{Add, Div, Mul, Rem, Sub};

+ 1 - 5
tests/cast.rs

@@ -1,10 +1,6 @@
 //! Tests of `num_traits::cast`.
 
-#![no_std]
-
-#[cfg(feature = "std")]
-#[macro_use]
-extern crate std;
+#![cfg_attr(not(feature = "std"), no_std)]
 
 use num_traits::cast::*;
 use num_traits::Bounded;