Skip to content

Commit

Permalink
Clippy: fix unnecessary_map_or lint (#621)
Browse files Browse the repository at this point in the history
Replace Option::map_or(false, ...) with Option::is_some_and, new in Rust
1.70.0 .
  • Loading branch information
asomers authored Nov 17, 2024
1 parent e1ac2e1 commit dee7bcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mockall_derive/src/mock_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fn destrify(ty: &mut Type) {
/// Return the owned version of the input.
fn ownify(ty: &Type) -> Type {
if let Type::Reference(ref tr) = &ty {
if tr.lifetime.as_ref().map_or(false, |lt| lt.ident == "static")
if tr.lifetime.as_ref().is_some_and(|lt| lt.ident == "static")
{
// Just a static expectation
ty.clone()
Expand Down

0 comments on commit dee7bcb

Please sign in to comment.