Skip to content

Commit

Permalink
Format Rust code using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Apr 22, 2024
1 parent 907f519 commit eb872cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pub trait CapitalizeIter: Iterator<Item = char> {

impl<T: Iterator<Item = char>> CapitalizeIter for T {
#[inline]
fn capitalize(&mut self) -> impl Iterator<Item=char> {
self.next().into_iter()
fn capitalize(&mut self) -> impl Iterator<Item = char> {
self.next()
.into_iter()
.flat_map(char::to_uppercase)
.chain(self.flat_map(char::to_lowercase))
}
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ impl<T: AsRef<str>> Capitalize for T {
.intersperse(" ")
.map(|item| {
let mut chars = item.chars();
chars.next().into_iter()
chars
.next()
.into_iter()
.flat_map(char::to_uppercase)
.chain(chars.flat_map(char::to_lowercase))
})
Expand Down

0 comments on commit eb872cd

Please sign in to comment.