Skip to content

Commit bc85f8b

Browse files
committed
fix lints
1 parent 083d6f6 commit bc85f8b

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

crates/lib/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ fn get_user_agent() -> String {
2929
let os = std::env::consts::OS;
3030
let arch = std::env::consts::ARCH;
3131
let group = env::var("PKGX_USER_AGENT_GROUP");
32-
let name = if group.is_ok() {
33-
format!("pkgx[{}]", group.unwrap())
32+
let name = if let Ok(valid_group) = group {
33+
format!("pkgx[{}]", valid_group)
3434
} else {
3535
"pkgx".to_string()
3636
};

crates/lib/src/install.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ where
9999
});
100100

101101
let stream = stream
102-
.map_err(|e| futures::io::Error::new(futures::io::ErrorKind::Other, e))
102+
.map_err(|e| futures::io::Error::other(e))
103103
.into_async_read();
104104
let stream = stream.compat();
105105

@@ -169,8 +169,7 @@ async fn symlink(installation: &Installation, config: &Config) -> Result<(), Box
169169
};
170170
let most_minor = versions
171171
.iter()
172-
.filter(|(version, _)| minor_range.satisfies(version))
173-
.next_back()
172+
.rfind(|(version, _)| minor_range.satisfies(version))
174173
.ok_or_else(|| {
175174
anyhow::anyhow!(
176175
"Could not find most minor version for {}",

crates/lib/src/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async fn download_and_extract_pantry(url: &str, dest: &PathBuf) -> Result<(), Bo
5959
let stream = rsp.bytes_stream();
6060

6161
let stream = stream
62-
.map_err(|e| futures::io::Error::new(futures::io::ErrorKind::Other, e))
62+
.map_err(|e| futures::io::Error::other(e))
6363
.into_async_read();
6464
let stream = stream.compat();
6565

0 commit comments

Comments
 (0)