[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] = &[
|
||||
"aback",
|
||||
pub const LIST: &'static [&'static str] = &["aback",
|
||||
"abaft",
|
||||
"abandoned",
|
||||
"abashed",
|
||||
|
@ -1122,5 +1121,4 @@ pub const LIST: &'static [&'static str] = &[
|
|||
"zealous",
|
||||
"zesty",
|
||||
"zippy",
|
||||
"zonked",
|
||||
];
|
||||
"zonked"];
|
||||
|
|
17
src/lib.rs
17
src/lib.rs
|
@ -74,11 +74,13 @@ pub enum Name {
|
|||
Plain,
|
||||
/// This represents a naming strategy with a random number appended to the
|
||||
/// end, of the form `"ADJECTIVE-NOUN-NUMBER"`
|
||||
Numbered
|
||||
Numbered,
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -108,11 +110,7 @@ impl<'a> Generator<'a> {
|
|||
///
|
||||
/// assert_eq!("sassy-clocks", generator.next().unwrap());
|
||||
/// ```
|
||||
pub fn new(
|
||||
adjectives: &'a [&'a str],
|
||||
nouns: &'a [&'a str],
|
||||
naming: Name
|
||||
) -> Generator<'a> {
|
||||
pub fn new(adjectives: &'a [&'a str], nouns: &'a [&'a str], naming: Name) -> Generator<'a> {
|
||||
Generator {
|
||||
adjectives: adjectives,
|
||||
nouns: nouns,
|
||||
|
@ -131,10 +129,7 @@ impl<'a> Generator<'a> {
|
|||
/// println!("My new name is: {}", generator.next().unwrap());
|
||||
/// ```
|
||||
pub fn with_naming(naming: Name) -> Generator<'a> {
|
||||
Generator::new(
|
||||
adjectives::LIST,
|
||||
nouns::LIST,
|
||||
naming)
|
||||
Generator::new(adjectives::LIST, nouns::LIST, naming)
|
||||
}
|
||||
|
||||
fn rand_adj(&self) -> &str {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
pub const LIST: &'static [&'static str] = &[
|
||||
"able",
|
||||
pub const LIST: &'static [&'static str] = &["able",
|
||||
"account",
|
||||
"achieve",
|
||||
"achiever",
|
||||
|
@ -979,5 +978,4 @@ pub const LIST: &'static [&'static str] = &[
|
|||
"zephyr",
|
||||
"zinc",
|
||||
"zipper",
|
||||
"zoo",
|
||||
];
|
||||
"zoo"];
|
||||
|
|
Loading…
Reference in New Issue