8000 Formating & Linting · Allstreamer/rust-pip@45801c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 45801c6

Browse files
committed
Formating & Linting
- Ran clippy - Ran fmt - Ran test
1 parent c944ce1 commit 45801c6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/package_version.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use pomsky_macro::pomsky;
55
use serde::{Deserialize, Serialize};
66
use std::{cmp::Ordering, fmt};
77

8-
static VALIDATION_REGEX: &'static str = pomsky!(
8+
static VALIDATION_REGEX: &str = pomsky!(
99
"v"?
1010

1111
(:epoch(['0'-'9']+)'!')?
@@ -90,7 +90,7 @@ impl PartialOrd for PostHeader {
9090
}
9191

9292
if self.post_num < other.post_num {
93-
return Some(Ordering::Less);
93+
Some(Ordering::Less)
9494
} else {
9595
Some(Ordering::Greater)
9696
}
@@ -123,7 +123,7 @@ pub struct ReleaseHeader {
123123
/// corretly interpets priority
124124
///
125125
/// Lower == More important
126-
///
126+
///
127127
/// # Example Usage
128128
/// ```
129129
/// let _ = PackageVersion::new("v1.0");
@@ -186,8 +186,8 @@ impl PackageVersion {
186186

187187
let release: ReleaseHeader = match version_match.name("release") {
188188
Some(v) => {
189-
if v.as_str().contains(".") {
190-
let split: Vec<&str> = v.as_str().split(".").into_iter().collect();
189+
if v.as_str().contains('.') {
190+
let split: Vec<&str> = v.as_str().split('.').into_iter().collect();
191191
ReleaseHeader {
192192
major: split[0].parse::<u32>()?,
193193
minor: split[1].parse::<u32>()?,
@@ -268,10 +268,8 @@ impl PackageVersion {
268268
None => None,
269269
};
270270

271-
let local: Option<String> = match version_match.name("local") {
272-
Some(v) => Some(v.as_str().to_string()),
273-
None => None,
274-
};
271+
let local: Option<String> =
272+
version_match.name("local").map(|v| v.as_str().to_string());
275273

276274
Ok(Self {
277275
original: version.to_string(),

0 commit comments

Comments
 (0)
0