Skip to content

Commit

Permalink
chore: fix clippy warn
Browse files Browse the repository at this point in the history
  • Loading branch information
4rgon4ut committed Nov 1, 2024
1 parent 45b5246 commit 8f85a53
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions examples/overflow/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ pub fn main() {
}

fn handle_result(res: Result<(), Box<dyn Any + Send>>) {
match &res {
Err(e) => match e.downcast_ref::<String>() {
Some(msg) => println!("> Panic occurred with message: {}\n", msg),
_ => (),
},
_ => (),
if let Err(e) = &res {
if let Some(msg) = e.downcast_ref::<String>() {
println!("--> Panic occurred with message: {}\n", msg);
}
}
}

0 comments on commit 8f85a53

Please sign in to comment.