浏览代码

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;