From 1e32721486a142e0f4f6aa654fe67c958bed8b9b Mon Sep 17 00:00:00 2001 From: cksac Date: Tue, 29 Oct 2024 23:04:35 +0800 Subject: [PATCH] bump versions --- README.md | 2 +- dummy_derive/Cargo.toml | 2 +- dummy_derive/README.md | 2 +- fake/Cargo.toml | 26 +++++++++++++------------- fake/README.md | 2 +- fake/src/faker/impls/color.rs | 12 ++++++------ fake/src/impls/color/mod.rs | 14 ++++++-------- 7 files changed, 29 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 4794456..0da539d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Default: ```toml [dependencies] -fake = { version = "2.10.0", features = ["derive"] } +fake = { version = "3.0.0", features = ["derive"] } ``` Available features: diff --git a/dummy_derive/Cargo.toml b/dummy_derive/Cargo.toml index 0ecd999..f15e293 100644 --- a/dummy_derive/Cargo.toml +++ b/dummy_derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dummy" -version = "0.8.0" +version = "0.9.0" authors = ["cksac "] description = "Macros implementation of #[derive(Dummy)]" keywords = ["faker", "data", "random"] diff --git a/dummy_derive/README.md b/dummy_derive/README.md index dfce94c..e2a8575 100644 --- a/dummy_derive/README.md +++ b/dummy_derive/README.md @@ -8,7 +8,7 @@ This crate provide derive(Dummy) macros. use it via `fake` crate with derive fea ```toml [dependencies] -fake = { version = "2.8", features=["derive"] } +fake = { version = "3.0", features=["derive"] } ``` ## Usage diff --git a/fake/Cargo.toml b/fake/Cargo.toml index 9e529af..a1cb9c7 100644 --- a/fake/Cargo.toml +++ b/fake/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fake" -version = "2.10.0" +version = "3.0.0" authors = ["cksac "] description = "An easy to use library for generating fake data like name, number, address, lorem, dates, etc." keywords = ["faker", "data", "generator", "random"] @@ -15,30 +15,30 @@ rust-version = "1.63" all-features = true [dependencies] -dummy = { version = "0.8", path = "../dummy_derive", optional = true } +dummy = { version = "0.9", path = "../dummy_derive", optional = true } rand = "0.8" -random_color = { version = "0.8", optional = true } -deunicode = "1.4" +random_color = { version = "1", optional = true } +deunicode = "1.6" chrono = { version = "0.4", features = [ "std", ], default-features = false, optional = true } -chrono-tz = { version = "0.9", optional = true } +chrono-tz = { version = "0.10", optional = true } geo-types = { version = "0.7", default-features = false, optional = true } http = { version = "1", optional = true } semver = { version = "1", optional = true } -serde_json = { version = "1.0", optional = true } -ulid = { version = "1.1", optional = true } -uuid = { version = "1.5", features = ["v1", "v3", "v4", "v5"], optional = true } +serde_json = { version = "1", optional = true } +ulid = { version = "1", optional = true } +uuid = { version = "1", features = ["v1", "v3", "v4", "v5"], optional = true } time = { version = "0.3", features = ["formatting"], optional = true } num-traits = { version = "0.2", optional = true } -rust_decimal = { version = "1.32", default-features = false, optional = true } +rust_decimal = { version = "1", default-features = false, optional = true } bigdecimal-rs = { version = "0.4", package = "bigdecimal", default-features = false, optional = true } -zerocopy = { version = "0.7", optional = true } +zerocopy = { version = "0.8", optional = true } rand_core = { version = "0.6", optional = true } -glam = { version = "0.29.0", optional = true } +glam = { version = "0.29", optional = true } url-escape = { version = "0.1", optional = true } -bson = { version = "2.10", optional = true } -url = { version = "2.5.2", optional = true } +bson = { version = "2", optional = true } +url = { version = "2", optional = true } indexmap = { version = "2", optional = true} [dev-dependencies] diff --git a/fake/README.md b/fake/README.md index 55e0e15..259cceb 100644 --- a/fake/README.md +++ b/fake/README.md @@ -11,7 +11,7 @@ Default: ```toml [dependencies] -fake = { version = "2.10.0", features = ["derive"] } +fake = { version = "2.11.0", features = ["derive"] } ``` Available features: diff --git a/fake/src/faker/impls/color.rs b/fake/src/faker/impls/color.rs index 4774311..f8f2ad7 100644 --- a/fake/src/faker/impls/color.rs +++ b/fake/src/faker/impls/color.rs @@ -6,7 +6,7 @@ use rand::Rng; impl Dummy> for String { #[inline] fn dummy_with_rng(_: &HexColor, rng: &mut R) -> Self { - let color: random_color::RandomColor = Faker.fake_with_rng(rng); + let mut color: random_color::RandomColor = Faker.fake_with_rng(rng); color.to_hex() } } @@ -14,7 +14,7 @@ impl Dummy> for String { impl Dummy> for String { #[inline] fn dummy_with_rng(_: &RgbColor, rng: &mut R) -> Self { - let color: random_color::RandomColor = Faker.fake_with_rng(rng); + let mut color: random_color::RandomColor = Faker.fake_with_rng(rng); color.to_rgb_string() } } @@ -22,7 +22,7 @@ impl Dummy> for String { impl Dummy> for String { #[inline] fn dummy_with_rng(_: &RgbaColor, rng: &mut R) -> Self { - let color: random_color::RandomColor = Faker.fake_with_rng(rng); + let mut color: random_color::RandomColor = Faker.fake_with_rng(rng); color.to_rgba_string() } } @@ -30,7 +30,7 @@ impl Dummy> for String { impl Dummy> for String { #[inline] fn dummy_with_rng(_: &HslColor, rng: &mut R) -> Self { - let color: random_color::RandomColor = Faker.fake_with_rng(rng); + let mut color: random_color::RandomColor = Faker.fake_with_rng(rng); color.to_hsl_string() } } @@ -38,7 +38,7 @@ impl Dummy> for String { impl Dummy> for String { #[inline] fn dummy_with_rng(_: &HslaColor, rng: &mut R) -> Self { - let color: random_color::RandomColor = Faker.fake_with_rng(rng); + let mut color: random_color::RandomColor = Faker.fake_with_rng(rng); color.to_hsla_string() } } @@ -46,7 +46,7 @@ impl Dummy> for String { impl Dummy> for String { #[inline] fn dummy_with_rng(_: &Color, rng: &mut R) -> Self { - let _color: random_color::RandomColor = Faker.fake_with_rng(rng); + let mut _color: random_color::RandomColor = Faker.fake_with_rng(rng); format!( "{}\n{}\n{}\n{}\n{}", _color.to_hex(), diff --git a/fake/src/impls/color/mod.rs b/fake/src/impls/color/mod.rs index c020700..477c3cd 100644 --- a/fake/src/impls/color/mod.rs +++ b/fake/src/impls/color/mod.rs @@ -1,16 +1,14 @@ use crate::{Dummy, Fake, Faker}; use rand::Rng; -use random_color::{Luminosity, RandomColor}; +use random_color::{options::Luminosity, RandomColor}; impl Dummy for RandomColor { fn dummy_with_rng(_: &Faker, rng: &mut R) -> Self { - RandomColor { - hue: None, - luminosity: Some(Luminosity::Random), - seed: Some((u64::MIN..u64::MAX).fake_with_rng::(rng)), - alpha: Some((0..10).fake_with_rng::(rng) as f32 / 10.), - ..Default::default() - } + let mut c = RandomColor::new(); + c.seed(Faker.fake_with_rng::(rng)) + .alpha(Faker.fake_with_rng::(rng)) + .luminosity(Luminosity::Random); + c } }