Skip to content

Commit

Permalink
chore: Apply Clippy lint redundant_pattern_matching again
Browse files Browse the repository at this point in the history
  • Loading branch information
jbencin committed Jan 23, 2025
1 parent da64cec commit 34e34ef
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions stackslib/src/chainstate/stacks/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2746,7 +2746,7 @@ pub mod test {
balances: Vec<(StacksAddress, u64)>,
) -> StacksChainState {
let path = chainstate_path(test_name);
if let Ok(_) = fs::metadata(&path) {
if fs::metadata(&path).is_ok() {
fs::remove_dir_all(&path).unwrap();
};

Expand Down Expand Up @@ -2863,7 +2863,7 @@ pub mod test {
};

let path = chainstate_path(function_name!());
if let Ok(_) = fs::metadata(&path) {
if fs::metadata(&path).is_ok() {
fs::remove_dir_all(&path).unwrap();
};

Expand Down Expand Up @@ -2950,7 +2950,7 @@ pub mod test {
};

let path = chainstate_path(function_name!());
if let Ok(_) = fs::metadata(&path) {
if fs::metadata(&path).is_ok() {
fs::remove_dir_all(&path).unwrap();
};

Expand Down
4 changes: 2 additions & 2 deletions stackslib/src/chainstate/stacks/index/test/marf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ fn marf_insert_random_10485760_4096_file_storage() {
}

let path = "/tmp/rust_marf_insert_random_10485760_4096_file_storage".to_string();
if let Ok(_) = fs::metadata(&path) {
if fs::metadata(&path).is_ok() {
fs::remove_dir_all(&path).unwrap();
};
let marf_opts = MARFOpenOpts::default();
Expand Down Expand Up @@ -1564,7 +1564,7 @@ fn marf_read_random_1048576_4096_file_storage() {
for marf_opts in MARFOpenOpts::all().into_iter() {
test_debug!("With {:?}", &marf_opts);
let path = "/tmp/rust_marf_insert_random_1048576_4096_file_storage".to_string();
if let Err(_) = fs::metadata(&path) {
if fs::metadata(&path).is_err() {
eprintln!("Run the marf_insert_random_1048576_4096_file_storage test first");
return;
};
Expand Down
4 changes: 2 additions & 2 deletions stackslib/src/chainstate/stacks/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl TestStacksNode {
panic!("Tried to fork an unforkable chainstate instance");
}

if let Ok(_) = fs::metadata(&chainstate_path(new_test_name)) {
if fs::metadata(&chainstate_path(new_test_name)).is_ok() {
fs::remove_dir_all(&chainstate_path(new_test_name)).unwrap();
}

Expand Down Expand Up @@ -1418,7 +1418,7 @@ pub fn instantiate_and_exec(
post_flight_callback: Option<Box<dyn FnOnce(&mut ClarityTx)>>,
) -> StacksChainState {
let path = chainstate_path(test_name);
if let Ok(_) = fs::metadata(&path) {
if fs::metadata(&path).is_ok() {
fs::remove_dir_all(&path).unwrap();
};

Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/net/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3106,7 +3106,7 @@ mod test {
services: u16,
) -> (PeerDB, SortitionDB, StackerDBs, PoxId, StacksChainState) {
let test_path = format!("/tmp/stacks-test-databases-{}", testname);
if let Ok(_) = fs::metadata(&test_path) {
if fs::metadata(&test_path).is_ok() {
fs::remove_dir_all(&test_path).unwrap();
};

Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ pub mod test {

pub fn make_test_path(config: &TestPeerConfig) -> String {
let test_path = TestPeer::test_path(&config);
if let Ok(_) = fs::metadata(&test_path) {
if fs::metadata(&test_path).is_ok() {
fs::remove_dir_all(&test_path).unwrap();
};

Expand Down
2 changes: 1 addition & 1 deletion stackslib/src/net/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ mod test {
peer.step().unwrap();

// asked to yield?
if let Ok(_) = http_rx.try_recv() {
if http_rx.try_recv().is_ok() {
break;
}
}
Expand Down

0 comments on commit 34e34ef

Please sign in to comment.