Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Oct 16, 2024
1 parent b848f5d commit d0963f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions fake/src/faker/impls/internet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl<L: Data> Dummy<Password<L>> for String {

impl<L: Data> Dummy<IPv4<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &IPv4<L>, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(u8::min_value(), u8::max_value());
let u = Uniform::new_inclusive(u8::MIN, u8::MAX);
format!(
"{}.{}.{}.{}",
u.sample(rng),
Expand All @@ -106,7 +106,7 @@ impl<L: Data> Dummy<IPv4<L>> for Ipv4Addr {

impl<L: Data> Dummy<IPv6<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &IPv6<L>, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(u16::min_value(), u16::max_value());
let u = Uniform::new_inclusive(u16::MIN, u16::MAX);
format!(
"{:X}:{:X}:{:X}:{:X}:{:X}:{:X}:{:X}:{:X}",
u.sample(rng),
Expand Down Expand Up @@ -143,7 +143,7 @@ impl<L: Data> Dummy<IP<L>> for IpAddr {

impl<L: Data> Dummy<MACAddress<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &MACAddress<L>, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(u8::min_value(), u8::max_value());
let u = Uniform::new_inclusive(u8::MIN, u8::MAX);
format!(
"{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}",
u.sample(rng),
Expand Down
4 changes: 2 additions & 2 deletions fake/src/impls/std/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6};

impl Dummy<Faker> for Ipv4Addr {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(u8::min_value(), u8::max_value());
let u = Uniform::new_inclusive(u8::MIN, u8::MAX);
Ipv4Addr::new(u.sample(rng), u.sample(rng), u.sample(rng), u.sample(rng))
}
}

impl Dummy<Faker> for Ipv6Addr {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(u16::min_value(), u16::max_value());
let u = Uniform::new_inclusive(u16::MIN, u16::MAX);
Ipv6Addr::new(
u.sample(rng),
u.sample(rng),
Expand Down
8 changes: 4 additions & 4 deletions fake/src/impls/std/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ macro_rules! range_impl {

impl Dummy<ops::RangeFrom<Self>> for $typ {
fn dummy_with_rng<R: Rng + ?Sized>(range: &ops::RangeFrom<Self>, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(range.start, std::$typ::MAX);
let u = Uniform::new_inclusive(range.start, $typ::MAX);
u.sample(rng)
}
}

impl Dummy<ops::RangeFull> for $typ {
fn dummy_with_rng<R: Rng + ?Sized>(_: &ops::RangeFull, rng: &mut R) -> Self {
let u = Uniform::new_inclusive(std::$typ::MIN, std::$typ::MAX);
let u = Uniform::new_inclusive($typ::MIN, $typ::MAX);
u.sample(rng)
}
}
Expand All @@ -57,7 +57,7 @@ macro_rules! range_impl {

impl Dummy<ops::RangeTo<Self>> for $typ {
fn dummy_with_rng<R: Rng + ?Sized>(range: &ops::RangeTo<Self>, rng: &mut R) -> Self {
rng.gen_range(std::$typ::MIN..range.end)
rng.gen_range($typ::MIN..range.end)
}
}

Expand All @@ -66,7 +66,7 @@ macro_rules! range_impl {
range: &ops::RangeToInclusive<Self>,
rng: &mut R,
) -> Self {
let u = Uniform::new_inclusive(std::$typ::MIN, range.end);
let u = Uniform::new_inclusive($typ::MIN, range.end);
u.sample(rng)
}
}
Expand Down
2 changes: 1 addition & 1 deletion fake/src/locales/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct RegistrantRule {
pub registrant_len: i8,
}

#[cfg_attr(tool_attributes, rustfmt_skip)]
#[rustfmt::skip]
pub trait Data {
const LOREM_WORD: &'static [&'static str] = &["alias", "consequatur", "aut", "perferendis", "sit", "voluptatem", "accusantium", "doloremque", "aperiam", "eaque", "ipsa", "quae", "ab", "illo", "inventore", "veritatis", "et", "quasi", "architecto", "beatae", "vitae", "dicta", "sunt", "explicabo", "aspernatur", "aut", "odit", "aut", "fugit", "sed", "quia", "consequuntur", "magni", "dolores", "eos", "qui", "ratione", "voluptatem", "sequi", "nesciunt", "neque", "dolorem", "ipsum", "quia", "dolor", "sit", "amet", "consectetur", "adipisci", "velit", "sed", "quia", "non", "numquam", "eius", "modi", "tempora", "incidunt", "ut", "labore", "et", "dolore", "magnam", "aliquam", "quaerat", "voluptatem", "ut", "enim", "ad", "minima", "veniam", "quis", "nostrum", "exercitationem", "ullam", "corporis", "nemo", "enim", "ipsam", "voluptatem", "quia", "voluptas", "sit", "suscipit", "laboriosam", "nisi", "ut", "aliquid", "ex", "ea", "commodi", "consequatur", "quis", "autem", "vel", "eum", "iure", "reprehenderit", "qui", "in", "ea", "voluptate", "velit", "esse", "quam", "nihil", "molestiae", "et", "iusto", "odio", "dignissimos", "ducimus", "qui", "blanditiis", "praesentium", "laudantium", "totam", "rem", "voluptatum", "deleniti", "atque", "corrupti", "quos", "dolores", "et", "quas", "molestias", "excepturi", "sint", "occaecati", "cupiditate", "non", "provident", "sed", "ut", "perspiciatis", "unde", "omnis", "iste", "natus", "error", "similique", "sunt", "in", "culpa", "qui", "officia", "deserunt", "mollitia", "animi", "id", "est", "laborum", "et", "dolorum", "fuga", "et", "harum", "quidem", "rerum", "facilis", "est", "et", "expedita", "distinctio", "nam", "libero", "tempore", "cum", "soluta", "nobis", "est", "eligendi", "optio", "cumque", "nihil", "impedit", "quo", "porro", "quisquam", "est", "qui", "minus", "id", "quod", "maxime", "placeat", "facere", "possimus", "omnis", "voluptas", "assumenda", "est", "omnis", "dolor", "repellendus", "temporibus", "autem", "quibusdam", "et", "aut", "consequatur", "vel", "illum", "qui", "dolorem", "eum", "fugiat", "quo", "voluptas", "nulla", "pariatur", "at", "vero", "eos", "et", "accusamus", "officiis", "debitis", "aut", "rerum", "necessitatibus", "saepe", "eveniet", "ut", "et", "voluptates", "repudiandae", "sint", "et", "molestiae", "non", "recusandae", "itaque", "earum", "rerum", "hic", "tenetur", "a", "sapiente", "delectus", "ut", "aut", "reiciendis", "voluptatibus", "maiores", "doloribus", "asperiores", "repellat"];

Expand Down

0 comments on commit d0963f0

Please sign in to comment.