Skip to content

Commit 8ce181b

Browse files
committed
Fix clippy warnings
1 parent b14fb2e commit 8ce181b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/distribution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use zip::ZipArchive;
1313
use crate::{Error, Metadata};
1414

1515
/// Python package distribution type
16-
#[derive(Debug, Clone, Copy, PartialEq)]
16+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1717
pub enum DistributionType {
1818
/// Source distribution
1919
SDist,
@@ -233,7 +233,7 @@ impl Distribution {
233233
if top_level_files.len() == 1 {
234234
let mut buf = Vec::new();
235235
archive
236-
.by_name(&top_level_files[0])?
236+
.by_name(top_level_files[0])?
237237
.read_to_end(&mut buf)?;
238238
return Metadata::parse(&buf);
239239
}

src/metadata.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::Error;
88

99
/// Python package metadata
1010
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
11-
#[derive(Debug, Clone, Default, PartialEq)]
11+
#[derive(Debug, Clone, Default, PartialEq, Eq)]
1212
pub struct Metadata {
1313
/// Version of the file format; legal values are `1.0`, `1.1`, `1.2`, `2.1` and `2.2`.
1414
pub metadata_version: String,
@@ -108,13 +108,13 @@ impl Metadata {
108108
};
109109
let metadata_version = headers
110110
.get_first_value("Metadata-Version")
111-
.ok_or_else(|| Error::FieldNotFound("Metadata-Version"))?;
111+
.ok_or(Error::FieldNotFound("Metadata-Version"))?;
112112
let name = headers
113113
.get_first_value("Name")
114-
.ok_or_else(|| Error::FieldNotFound("Name"))?;
114+
.ok_or(Error::FieldNotFound("Name"))?;
115115
let version = headers
116116
.get_first_value("Version")
117-
.ok_or_else(|| Error::FieldNotFound("Version"))?;
117+
.ok_or(Error::FieldNotFound("Version"))?;
118118
let platforms = get_all_values("Platform");
119119
let supported_platforms = get_all_values("Supported-Platform");
120120
let summary = get_first_value("Summary");

0 commit comments

Comments
 (0)