Skip to content

Commit

Permalink
fix: cargo clippy fix
Browse files Browse the repository at this point in the history
Signed-off-by: Chawye Hsu <[email protected]>
  • Loading branch information
chawyehsu committed Jul 22, 2024
1 parent df62d5f commit 71a7596
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/libscoop/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl FromStr for IsolatedPath {

// `=` is not a valid character in environment variable names
// ref: https://learn.microsoft.com/en-us/windows/win32/procthread/environment-variables
if s.contains("=") {
if s.contains('=') {
return Err(Error::ConfigValueInvalid(s));
}

Expand Down
4 changes: 2 additions & 2 deletions crates/libscoop/src/internal/dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ where
.map(|(node, _)| node)
.next()
.cloned();
if node.is_some() {
Self::__unregister(&mut self.nodes, node.as_ref().unwrap());
if let Some(node) = &node {
Self::__unregister(&mut self.nodes, node);
}
node
}
Expand Down
2 changes: 1 addition & 1 deletion crates/libscoop/src/package/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl<'a> PackageSet<'a> {
}
}

fn set_cookie(easy: &mut Easy, cookie: &Vec<(&str, &str)>) -> Fallible<()> {
fn set_cookie(easy: &mut Easy, cookie: &[(&str, &str)]) -> Fallible<()> {
if !cookie.is_empty() {
let mut header_cookie = String::from("Cookie: ");
header_cookie.push_str(
Expand Down
2 changes: 1 addition & 1 deletion src/cui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl BucketUpdateUI {
.unwrap()
.execute(Print(format!("{} {}\n", name, "Ok".green())))
.unwrap(),
BucketState::Failed(_) => stdout
BucketState::Failed(_err) => stdout
.execute(Clear(ClearType::CurrentLine))
.unwrap()
.execute(Print(format!("{} {}\n", name, "Err".red())))
Expand Down

0 comments on commit 71a7596

Please sign in to comment.