fix some pedantic clippy lints that make sense
- clippy::redundant-closure-for-method-calls - clippy::explicit-iter-loop
This commit is contained in:
parent
449cdc0157
commit
e25bc47f8f
20 changed files with 59 additions and 66 deletions
|
|
@ -61,8 +61,8 @@ impl FromStr for Date {
|
|||
type Err = anyhow::Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self> {
|
||||
let lbracket = s.find('[').context("`[` not found")?;
|
||||
let s = &s[(lbracket + 1)..];
|
||||
let l_bracket = s.find('[').context("`[` not found")?;
|
||||
let s = &s[(l_bracket + 1)..];
|
||||
let dash = s.find('-').context("`-` not found")?;
|
||||
|
||||
let year = s[..dash].parse()?;
|
||||
|
|
@ -79,9 +79,9 @@ impl FromStr for Date {
|
|||
|
||||
let hour = s[..colon].parse()?;
|
||||
let s = &s[(colon + 1)..];
|
||||
let rbracket = s.find(']').context("`]` not found")?;
|
||||
let r_bracket = s.find(']').context("`]` not found")?;
|
||||
|
||||
let minute = s[..rbracket].parse()?;
|
||||
let minute = s[..r_bracket].parse()?;
|
||||
|
||||
Ok(Date {
|
||||
year,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue