Skip to content

Commit

Permalink
style: Inline format args
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 26, 2024
1 parent 9bc9764 commit ac48d6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ where
match decoder.verify_invalid_case(case.fixture) {
Ok(err) => {
if nocapture {
let _ = writeln!(std::io::stdout(), "{}", err);
let _ = writeln!(std::io::stdout(), "{err}");
}
Ok(())
}
Expand Down
8 changes: 4 additions & 4 deletions src/decoded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,28 +158,28 @@ impl PartialEq for DecodedValue {
fn parse_date_time(s: &str) -> chrono::DateTime<chrono::FixedOffset> {
match normalize_datetime(s).parse() {
Ok(d) => d,
Err(err) => panic!("Failed to parse {:?}: {}", s, err),
Err(err) => panic!("Failed to parse {s:?}: {err}"),
}
}

fn parse_date_time_local(s: &str) -> chrono::NaiveDateTime {
match normalize_datetime(s).parse() {
Ok(d) => d,
Err(err) => panic!("Failed to parse {:?}: {}", s, err),
Err(err) => panic!("Failed to parse {s:?}: {err}"),
}
}

fn parse_date_local(s: &str) -> chrono::NaiveDate {
match s.parse() {
Ok(d) => d,
Err(err) => panic!("Failed to parse {:?}: {}", s, err),
Err(err) => panic!("Failed to parse {s:?}: {err}"),
}
}

fn parse_time_local(s: &str) -> chrono::NaiveTime {
match s.parse() {
Ok(d) => d,
Err(err) => panic!("Failed to parse {:?}: {}", s, err),
Err(err) => panic!("Failed to parse {s:?}: {err}"),
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ pub trait Encoder {
let actual = self.encode(decoded_expected.clone())?;
let decoded_actual = fixture.decode(actual.as_bytes()).map_err(|err| {
crate::Error::new(format!(
"Could not parse encoded TOML: {}\n```\n{}\n```",
err, actual
"Could not parse encoded TOML: {err}\n```\n{actual}\n```"
))
})?;

Expand Down

0 comments on commit ac48d6d

Please sign in to comment.