diff --git a/README.md b/README.md
index 326007e..2650b2f 100644
--- a/README.md
+++ b/README.md
@@ -56,7 +56,6 @@ Options:
-d, --dir
Use custom word lists by specifying a directory containing `adjectives.txt`, `adverbs.txt`, and `nouns.txt`
--count Generate multiple names; or use --stream to generate continuously [default: 1]
--stream Stream names continuously
- --non-repeating Do not generate the same name more than once
-l, --letters Maximum number of letters in each word; 0 for unlimited [default: 0]
-a, --alliterate Generate names where each word begins with the same letter
-A, --alliterate-with Generate names where each word begins with the given letter
diff --git a/src/cli.rs b/src/cli.rs
index 898df46..7fe3fee 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -36,10 +36,6 @@ pub struct Cli {
#[arg(long, conflicts_with = "count")]
pub stream: bool,
- /// Do not generate the same name more than once
- #[arg(long)]
- pub non_repeating: bool,
-
/// Maximum number of letters in each word; 0 for unlimited
#[arg(short, long, value_name = "LETTERS", default_value_t = 0)]
pub letters: usize,
diff --git a/src/lib.rs b/src/lib.rs
index b4b0249..0b95a1f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -60,7 +60,6 @@ extern crate alloc;
use alloc::{
borrow::Cow,
string::{String, ToString},
- vec::Vec,
};
use itertools::Itertools;
@@ -252,40 +251,6 @@ impl<'a> Petnames<'a> {
{
Names { petnames: self, rng, words, separator: separator.to_string() }
}
-
- /// Iterator yielding unique – i.e. non-repeating – petnames.
- ///
- /// # Examples
- ///
- /// ```rust
- /// # #[cfg(all(feature = "default-rng", feature = "default-words"))]
- /// let mut rng = rand::thread_rng();
- /// # #[cfg(all(feature = "default-rng", feature = "default-words"))]
- /// let petnames = petname::Petnames::default();
- /// # #[cfg(all(feature = "default-rng", feature = "default-words"))]
- /// let mut iter = petnames.iter_non_repeating(&mut rng, 4, "_");
- /// # #[cfg(all(feature = "default-rng", feature = "default-words"))]
- /// println!("name: {}", iter.next().unwrap());
- /// ```
- ///
- pub fn iter_non_repeating(
- &'a self,
- rng: &'a mut RNG,
- words: u8,
- separator: &str,
- ) -> impl Iterator- + 'a
- where
- RNG: rand::Rng,
- {
- let lists: Vec<&'a Words<'a>> = Lists::new(words)
- .map(|list| match list {
- List::Adverb => &self.adverbs,
- List::Adjective => &self.adjectives,
- List::Noun => &self.nouns,
- })
- .collect();
- NamesProduct::shuffled(&lists, rng, separator)
- }
}
#[cfg(feature = "default-words")]
@@ -394,123 +359,6 @@ where
}
}
-/// Iterator yielding petnames from the product of given word lists.
-///
-/// This can be used to ensure that only unique names are produced.
-struct NamesProduct<'a, ITERATOR>
-where
- ITERATOR: Iterator
- >,
-{
- iters: Vec<(ITERATOR, Option<&'a str>)>,
- separator: String,
- capacity: usize,
- size: Option,
-}
-
-impl<'a> NamesProduct<'a, core::iter::Cycle>>> {
- /// Shuffles each of the given `lists` with `rng`, then cycles through the
- /// product of the lists, joining with `separator`. The leftmost list will
- /// cycle most rapidly.
- fn shuffled(lists: &[&'a Words<'a>], rng: &'a mut RNG, separator: &str) -> Self
- where
- RNG: rand::Rng,
- {
- NamesProduct {
- iters: lists
- .iter()
- .map(|words| {
- let mut list: Vec