Skip to content

Commit

Permalink
Apply cargo clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed Jan 17, 2025
1 parent dbd1eb7 commit 76478d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/rpm/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ impl PackageBuilder {
///
/// The a changelog entry consists of an entry name (which includes author, email followed by
/// a dash followed by a version number), description, and the date and time of the change.
/// ```
/// # #[cfg(feature = "chrono")]
/// # || -> Result<(), Box<dyn std::error::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion src/rpm/compressor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub(crate) fn decompress_stream(
#[cfg(feature = "xz-compression")]
CompressionType::Xz => Ok(Box::new(xz2::bufread::XzDecoder::new(reader))),
#[cfg(feature = "bzip2-compression")]
CompressionType::Bzip2 => Ok(Box::new(bzip2::read::BzipDecoder::new(reader))),
CompressionType::Bzip2 => Ok(Box::new(bzip2::bufread::BzDecoder::new(reader))),
// This is an issue when building with all compression types enabled
#[allow(unreachable_patterns)]
_ => Err(Error::UnsupportedCompressorType(value.to_string())),
Expand Down
1 change: 0 additions & 1 deletion src/rpm/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ impl Package {
"signature_header(header and content)",
signature_header_and_content,
);
use io::Read;
let header_and_content_cursor =
io::Cursor::new(&header_bytes).chain(io::Cursor::new(&self.content));
verifier.verify(header_and_content_cursor, signature_header_and_content)?;
Expand Down
14 changes: 7 additions & 7 deletions src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ impl<'a> Nevra<'a> {
}
}

impl<'a> fmt::Display for Nevra<'a> {
impl fmt::Display for Nevra<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}-{}.{}", self.name, self.evr, self.arch)
}
}

impl<'a> PartialOrd for Nevra<'a> {
impl PartialOrd for Nevra<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl<'a> Ord for Nevra<'a> {
impl Ord for Nevra<'_> {
fn cmp(&self, other: &Self) -> Ordering {
let name_cmp = compare_version_string(&self.name, &other.name);
if name_cmp != Ordering::Equal {
Expand Down Expand Up @@ -248,7 +248,7 @@ impl<'a> From<(&'a str, &'a str, &'a str)> for Evr<'a> {
}
}

impl<'a> PartialEq for Evr<'a> {
impl PartialEq for Evr<'_> {
fn eq(&self, other: &Self) -> bool {
((self.epoch == other.epoch)
|| (self.epoch == "" && other.epoch == "0")
Expand All @@ -258,7 +258,7 @@ impl<'a> PartialEq for Evr<'a> {
}
}

impl<'a> fmt::Display for Evr<'a> {
impl fmt::Display for Evr<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if !self.epoch.is_empty() {
write!(f, "{}:", self.epoch)?;
Expand All @@ -268,13 +268,13 @@ impl<'a> fmt::Display for Evr<'a> {
}
}

impl<'a> PartialOrd for Evr<'a> {
impl PartialOrd for Evr<'_> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}

impl<'a> Ord for Evr<'a> {
impl Ord for Evr<'_> {
fn cmp(&self, other: &Self) -> Ordering {
let epoch_1 = if self.epoch.is_empty() {
"0"
Expand Down

0 comments on commit 76478d8

Please sign in to comment.