diff --git a/fake/src/impls/glam/mod.rs b/fake/src/impls/glam/mod.rs index c21e18e..54e2273 100644 --- a/fake/src/impls/glam/mod.rs +++ b/fake/src/impls/glam/mod.rs @@ -1,5 +1,5 @@ -use glam::{Mat4, Vec2, Vec3, Vec4}; use crate::{Dummy, Fake, Faker}; +use glam::{Mat4, Vec2, Vec3, Vec4}; impl Dummy for Mat4 { fn dummy_with_rng(_f: &Faker, rng: &mut R) -> Self { diff --git a/fake/src/impls/mod.rs b/fake/src/impls/mod.rs index 855832a..4d332a0 100644 --- a/fake/src/impls/mod.rs +++ b/fake/src/impls/mod.rs @@ -12,6 +12,8 @@ pub mod color; pub mod decimal; #[cfg(feature = "geo-types")] pub mod geo; +#[cfg(feature = "glam")] +pub mod glam; #[cfg(feature = "http")] pub mod http; #[cfg(feature = "semver")] @@ -25,5 +27,3 @@ pub mod time; pub mod uuid; #[cfg(feature = "zerocopy")] pub mod zerocopy_byteorder; -#[cfg(feature = "glam")] -pub mod glam; diff --git a/fake/src/impls/std/num.rs b/fake/src/impls/std/num.rs index 80eace2..4221ffa 100644 --- a/fake/src/impls/std/num.rs +++ b/fake/src/impls/std/num.rs @@ -1,13 +1,14 @@ use crate::{Dummy, Faker}; use rand::distributions::{Distribution, Uniform}; use rand::Rng; -use std::num::{NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroIsize, -NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize}; +use std::num::{ + NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, + NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, +}; macro_rules! signed_faker_impl { ($nz_typ: ty, $typ:ty) => { - - impl Dummy for $nz_typ { + impl Dummy for $nz_typ { fn dummy_with_rng(_: &Faker, rng: &mut R) -> Self { if rng.gen_bool(0.5) { let u = Uniform::new_inclusive(<$typ>::MIN, -1); @@ -18,22 +19,20 @@ macro_rules! signed_faker_impl { } } } - } + }; } macro_rules! unsigned_faker_impl { ($nz_typ: ty, $typ:ty) => { - - impl Dummy for $nz_typ { + impl Dummy for $nz_typ { fn dummy_with_rng(_: &Faker, rng: &mut R) -> Self { let u = Uniform::new_inclusive(1, <$typ>::MAX); <$nz_typ>::new(u.sample(rng)).unwrap() } } - } + }; } - signed_faker_impl!(NonZeroI8, i8); signed_faker_impl!(NonZeroI16, i16); signed_faker_impl!(NonZeroI32, i32);