Skip to content

Commit 8231ba0

Browse files
committed
Import macros directly instead of doing cfg_attr macro_use contortions
1 parent e895ccd commit 8231ba0

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,8 @@ Lab 0.7.0 requires Rust >= 1.31.0 for the [chunks_exact](https://doc.rust-lang.o
8585
#[macro_use]
8686
extern crate pretty_assertions;
8787
#[cfg(test)]
88-
#[cfg_attr(all(target_arch = "x86_64", target_feature = "avx2"), macro_use)]
8988
extern crate approx;
9089
#[cfg(test)]
91-
#[cfg_attr(all(target_arch = "x86_64", target_feature = "avx2"), macro_use)]
9290
extern crate lazy_static;
9391
#[cfg(test)]
9492
extern crate rand;

src/simd/labs_to_rgbs.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ unsafe fn simd_to_rgb_bytes(r: __m256, g: __m256, b: __m256) -> [u8; 8 * 3] {
247247

248248
#[cfg(test)]
249249
mod test {
250-
use super::super::super::{labs_to_rgbs, simd, Lab};
250+
use crate::{labs_to_rgbs, simd, Lab};
251+
use lazy_static::lazy_static;
251252
use rand;
252253
use rand::distributions::Standard;
253254
use rand::Rng;

src/simd/math.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ pub unsafe fn powf256_ps(x: __m256, y: __m256) -> __m256 {
189189
#[cfg(test)]
190190
mod test {
191191
use super::{exp256_ps, log256_ps, powf256_ps};
192+
use approx::assert_relative_eq;
192193
use std::arch::x86_64::*;
193194
use std::{f32, mem};
194195

src/simd/rgbs_to_labs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ unsafe fn simd_to_lab_array(l: __m256, a: __m256, b: __m256) -> [Lab; 8] {
263263

264264
#[cfg(test)]
265265
mod test {
266-
use super::super::super::{rgbs_to_labs, simd};
266+
use crate::{rgbs_to_labs, simd};
267+
use approx::assert_relative_eq;
268+
use lazy_static::lazy_static;
267269
use rand;
268270
use rand::distributions::Standard;
269271
use rand::Rng;

0 commit comments

Comments
 (0)