Skip to content

Commit

Permalink
Merge pull request #469 from mgeisler/clippy
Browse files Browse the repository at this point in the history
Apply small Clippy suggestions
  • Loading branch information
mgeisler authored Sep 15, 2022
2 parents 73f1e4a + e2a111c commit e5c9a76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1678,8 +1678,8 @@ mod tests {
let green_hello = "\u{1b}[0m\u{1b}[32mHello\u{1b}[0m";
let blue_world = "\u{1b}[0m\u{1b}[34mWorld!\u{1b}[0m";
assert_eq!(
fill(&(String::from(green_hello) + " " + &blue_world), 6),
String::from(green_hello) + "\n" + &blue_world
fill(&(String::from(green_hello) + " " + blue_world), 6),
String::from(green_hello) + "\n" + blue_world
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/word_separators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ mod tests {
};
}

fn to_words<'a>(words: Vec<&'a str>) -> Vec<Word<'a>> {
words.into_iter().map(|w: &str| Word::from(&w)).collect()
fn to_words(words: Vec<&str>) -> Vec<Word<'_>> {
words.into_iter().map(Word::from).collect()
}

macro_rules! test_find_words {
Expand Down Expand Up @@ -427,11 +427,11 @@ mod tests {
#[test]
fn find_words_color_inside_word() {
let text = "foo\u{1b}[0m\u{1b}[32mbar\u{1b}[0mbaz";
assert_iter_eq!(AsciiSpace.find_words(&text), vec![Word::from(text)]);
assert_iter_eq!(AsciiSpace.find_words(text), vec![Word::from(text)]);

#[cfg(feature = "unicode-linebreak")]
assert_iter_eq!(
UnicodeBreakProperties.find_words(&text),
UnicodeBreakProperties.find_words(text),
vec![Word::from(text)]
);
}
Expand Down

0 comments on commit e5c9a76

Please sign in to comment.