Skip to content

Commit

Permalink
Fix Clippy warnings. (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloneable authored Aug 11, 2021
1 parent a90b8c2 commit e2c97ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/config/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ where
P: AsRef<Path>,
{
let path = path.as_ref();
let format = Format::from_path(&path)?;
let source = read_config(&path)?;
let format = Format::from_path(path)?;
let source = read_config(path)?;
let config = format.parse(&source)?;

Ok(deserialize(&config, &deserializers))
Expand Down
8 changes: 4 additions & 4 deletions src/encode/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ impl<'a> From<Piece<'a>> for Chunk {
let timezone = match formatter.args.get(1) {
Some(arg) => {
if let Some(arg) = arg.get(0) {
match arg {
Piece::Text(ref z) if *z == "utc" => Timezone::Utc,
Piece::Text(ref z) if *z == "local" => Timezone::Local,
Piece::Text(ref z) => {
match *arg {
Piece::Text(z) if z == "utc" => Timezone::Utc,
Piece::Text(z) if z == "local" => Timezone::Local,
Piece::Text(z) => {
return Chunk::Error(format!("invalid timezone `{}`", z));
}
_ => return Chunk::Error("invalid timezone".to_owned()),
Expand Down

0 comments on commit e2c97ea

Please sign in to comment.