Skip to content

Commit

Permalink
bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cksac committed Oct 29, 2024
1 parent da632de commit 1e32721
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Default:

```toml
[dependencies]
fake = { version = "2.10.0", features = ["derive"] }
fake = { version = "3.0.0", features = ["derive"] }
```

Available features:
Expand Down
2 changes: 1 addition & 1 deletion dummy_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dummy"
version = "0.8.0"
version = "0.9.0"
authors = ["cksac <[email protected]>"]
description = "Macros implementation of #[derive(Dummy)]"
keywords = ["faker", "data", "random"]
Expand Down
2 changes: 1 addition & 1 deletion dummy_derive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions fake/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fake"
version = "2.10.0"
version = "3.0.0"
authors = ["cksac <[email protected]>"]
description = "An easy to use library for generating fake data like name, number, address, lorem, dates, etc."
keywords = ["faker", "data", "generator", "random"]
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion fake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Default:

```toml
[dependencies]
fake = { version = "2.10.0", features = ["derive"] }
fake = { version = "2.11.0", features = ["derive"] }
```

Available features:
Expand Down
12 changes: 6 additions & 6 deletions fake/src/faker/impls/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,47 @@ use rand::Rng;
impl<L: Data> Dummy<HexColor<L>> for String {
#[inline]
fn dummy_with_rng<R: Rng + ?Sized>(_: &HexColor<L>, 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()
}
}

impl<L: Data> Dummy<RgbColor<L>> for String {
#[inline]
fn dummy_with_rng<R: Rng + ?Sized>(_: &RgbColor<L>, 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()
}
}

impl<L: Data> Dummy<RgbaColor<L>> for String {
#[inline]
fn dummy_with_rng<R: Rng + ?Sized>(_: &RgbaColor<L>, 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()
}
}

impl<L: Data> Dummy<HslColor<L>> for String {
#[inline]
fn dummy_with_rng<R: Rng + ?Sized>(_: &HslColor<L>, 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()
}
}

impl<L: Data> Dummy<HslaColor<L>> for String {
#[inline]
fn dummy_with_rng<R: Rng + ?Sized>(_: &HslaColor<L>, 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()
}
}

impl<L: Data> Dummy<Color<L>> for String {
#[inline]
fn dummy_with_rng<R: Rng + ?Sized>(_: &Color<L>, 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(),
Expand Down
14 changes: 6 additions & 8 deletions fake/src/impls/color/mod.rs
Original file line number Diff line number Diff line change
@@ -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<Faker> for RandomColor {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Faker, rng: &mut R) -> Self {
RandomColor {
hue: None,
luminosity: Some(Luminosity::Random),
seed: Some((u64::MIN..u64::MAX).fake_with_rng::<u64, _>(rng)),
alpha: Some((0..10).fake_with_rng::<i8, _>(rng) as f32 / 10.),
..Default::default()
}
let mut c = RandomColor::new();
c.seed(Faker.fake_with_rng::<u64, _>(rng))
.alpha(Faker.fake_with_rng::<f32, _>(rng))
.luminosity(Luminosity::Random);
c
}
}

0 comments on commit 1e32721

Please sign in to comment.