Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodie committed Nov 22, 2023
1 parent 5350170 commit cbd4114
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 5 additions & 3 deletions examples/example_utils.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use std::{env, fs, io};
use std::{env, fmt::Write, fs, io};
#[allow(dead_code)]
pub fn print_with_lines(content: &str) {
println!(
"{}",
content
.lines()
.enumerate()
.map(|(num, content)| format!("{:4}. {}\n", num + 1, content))
.collect::<String>()
.fold(String::new(), |mut out, (num, content)| {
let _ = writeln!(out, "{:4}. {}", num + 1, content);
out
})
);
}

Expand Down
6 changes: 2 additions & 4 deletions src/parser/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,9 @@ pub fn inner_component<'a, E: ParseError<&'a str> + ContextError<&'a str>>(
input: &'a str,
) -> IResult<&'a str, InnerComponent, E> {
match component::<(_, _)>(input) {
Ok(result) => {
return Ok((result.0, InnerComponent::from(result.1)));
}
Ok(result) => Ok((result.0, InnerComponent::from(result.1))),
Err(_e) => todo!(),
};
}
}

#[test]
Expand Down

0 comments on commit cbd4114

Please sign in to comment.