Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-tkach committed Jan 29, 2023
1 parent b377859 commit 7fc22cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions os_info/src/info.rs
Expand Up @@ -162,10 +162,10 @@ impl Display for Info {
write!(f, " {}", self.version)?;
}
if let Some(ref edition) = self.edition {
write!(f, " ({})", edition)?;
write!(f, " ({edition})")?;
}
if let Some(ref codename) = self.codename {
write!(f, " ({})", codename)?;
write!(f, " ({codename})")?;
}
write!(f, " [{}]", self.bitness)
}
Expand Down
2 changes: 1 addition & 1 deletion os_info/src/os_type.rs
Expand Up @@ -108,7 +108,7 @@ impl Display for Type {
Type::Redhat => write!(f, "Red Hat Linux"),
Type::RedHatEnterprise => write!(f, "Red Hat Enterprise Linux"),
Type::SUSE => write!(f, "SUSE Linux Enterprise Server"),
_ => write!(f, "{:?}", self),
_ => write!(f, "{self:?}"),
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions os_info/src/version.rs
Expand Up @@ -55,15 +55,15 @@ impl Display for Version {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
match *self {
Self::Unknown => f.write_str("Unknown"),
Self::Semantic(major, minor, patch) => write!(f, "{}.{}.{}", major, minor, patch),
Self::Semantic(major, minor, patch) => write!(f, "{major}.{minor}.{patch}"),
Self::Rolling(ref date) => {
let date = match date {
Some(date) => format!(" ({})", date),
Some(date) => format!(" ({date})"),
None => "".to_owned(),
};
write!(f, "Rolling Release{}", date)
write!(f, "Rolling Release{date}")
}
Self::Custom(ref version) => write!(f, "{}", version),
Self::Custom(ref version) => write!(f, "{version}"),
}
}
}
Expand Down

0 comments on commit 7fc22cb

Please sign in to comment.