[rustfmt] Updates simply due to current rustfmt.
Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
This commit is contained in:
parent
129d6830f8
commit
1b1bcfbd94
|
@ -1,5 +1,4 @@
|
||||||
pub const LIST: &'static [&'static str] = &[
|
pub const LIST: &'static [&'static str] = &["aback",
|
||||||
"aback",
|
|
||||||
"abaft",
|
"abaft",
|
||||||
"abandoned",
|
"abandoned",
|
||||||
"abashed",
|
"abashed",
|
||||||
|
@ -1122,5 +1121,4 @@ pub const LIST: &'static [&'static str] = &[
|
||||||
"zealous",
|
"zealous",
|
||||||
"zesty",
|
"zesty",
|
||||||
"zippy",
|
"zippy",
|
||||||
"zonked",
|
"zonked"];
|
||||||
];
|
|
||||||
|
|
17
src/lib.rs
17
src/lib.rs
|
@ -74,11 +74,13 @@ pub enum Name {
|
||||||
Plain,
|
Plain,
|
||||||
/// This represents a naming strategy with a random number appended to the
|
/// This represents a naming strategy with a random number appended to the
|
||||||
/// end, of the form `"ADJECTIVE-NOUN-NUMBER"`
|
/// end, of the form `"ADJECTIVE-NOUN-NUMBER"`
|
||||||
Numbered
|
Numbered,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Name {
|
impl Default for Name {
|
||||||
fn default() -> Name { Name::Plain }
|
fn default() -> Name {
|
||||||
|
Name::Plain
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A random name generator which combines an adjective, a noun, and an
|
/// A random name generator which combines an adjective, a noun, and an
|
||||||
|
@ -108,11 +110,7 @@ impl<'a> Generator<'a> {
|
||||||
///
|
///
|
||||||
/// assert_eq!("sassy-clocks", generator.next().unwrap());
|
/// assert_eq!("sassy-clocks", generator.next().unwrap());
|
||||||
/// ```
|
/// ```
|
||||||
pub fn new(
|
pub fn new(adjectives: &'a [&'a str], nouns: &'a [&'a str], naming: Name) -> Generator<'a> {
|
||||||
adjectives: &'a [&'a str],
|
|
||||||
nouns: &'a [&'a str],
|
|
||||||
naming: Name
|
|
||||||
) -> Generator<'a> {
|
|
||||||
Generator {
|
Generator {
|
||||||
adjectives: adjectives,
|
adjectives: adjectives,
|
||||||
nouns: nouns,
|
nouns: nouns,
|
||||||
|
@ -131,10 +129,7 @@ impl<'a> Generator<'a> {
|
||||||
/// println!("My new name is: {}", generator.next().unwrap());
|
/// println!("My new name is: {}", generator.next().unwrap());
|
||||||
/// ```
|
/// ```
|
||||||
pub fn with_naming(naming: Name) -> Generator<'a> {
|
pub fn with_naming(naming: Name) -> Generator<'a> {
|
||||||
Generator::new(
|
Generator::new(adjectives::LIST, nouns::LIST, naming)
|
||||||
adjectives::LIST,
|
|
||||||
nouns::LIST,
|
|
||||||
naming)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rand_adj(&self) -> &str {
|
fn rand_adj(&self) -> &str {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
pub const LIST: &'static [&'static str] = &[
|
pub const LIST: &'static [&'static str] = &["able",
|
||||||
"able",
|
|
||||||
"account",
|
"account",
|
||||||
"achieve",
|
"achieve",
|
||||||
"achiever",
|
"achiever",
|
||||||
|
@ -979,5 +978,4 @@ pub const LIST: &'static [&'static str] = &[
|
||||||
"zephyr",
|
"zephyr",
|
||||||
"zinc",
|
"zinc",
|
||||||
"zipper",
|
"zipper",
|
||||||
"zoo",
|
"zoo"];
|
||||||
];
|
|
||||||
|
|
Loading…
Reference in New Issue