Skip to content

Commit

Permalink
Merge pull request #149 from kornelski/deunicode
Browse files Browse the repository at this point in the history
Replace unmaintained dependency
  • Loading branch information
cksac committed Sep 19, 2023
2 parents 6651a39 + 9c42b35 commit 3f194f8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ all-features = true
dummy = { version = "0.6", path = "../dummy_derive", optional = true }
rand = "0.8"
random_color = { version = "0.6", optional = true }
unidecode = "0.3"
deunicode = "1.4"
chrono = { version = "0.4", features = [
"std",
], default-features = false, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions fake/src/faker/impls/internet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rand::distributions::{Distribution, Uniform};
use rand::seq::SliceRandom;
use rand::Rng;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use unidecode::unidecode;
use deunicode::AsciiChars;

impl<L: Data> Dummy<FreeEmailProvider<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &FreeEmailProvider<L>, rng: &mut R) -> Self {
Expand Down Expand Up @@ -39,7 +39,7 @@ impl<L: Data + Copy> Dummy<FreeEmail<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(c: &FreeEmail<L>, rng: &mut R) -> Self {
let username: String = Username(c.0).fake_with_rng(rng);
let provider: String = FreeEmailProvider(c.0).fake_with_rng(rng);
format!("{}@{}", unidecode(&username), provider)
format!("{}@{}", username.ascii_chars(), provider)
}
}

Expand Down
2 changes: 2 additions & 0 deletions fake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@
//! println!("value from fixed seed {}", v);
//! }
//!
//! # #[cfg(feture = "always-true-rng")] {
//! // Use an always true RNG so that optional types are always `Some` values. (Requires
//! // always-true-rng feature).
//! use fake::utils::AlwaysTrueRng;
//! let mut rng = AlwaysTrueRng::default();
//! let result: Option<i64> = Faker.fake_with_rng(&mut rng);
//! println!("Always Some: {}", result.unwrap());
//! # }
//! ```
#[doc(hidden)]
pub use rand::Rng;
Expand Down
1 change: 1 addition & 0 deletions fake/tests/always-true.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ mod always_true_tests {
assert_ne!(result.len(), 0);
}

#[cfg(feature = "maybe-non-empty-collections")]
#[test]
fn test_vec_never_empty() {
// Arrange
Expand Down

0 comments on commit 3f194f8

Please sign in to comment.