Skip to content

Commit

Permalink
Fix clippy warnings in clippy 1.85
Browse files Browse the repository at this point in the history
  • Loading branch information
dburgener committed Jan 10, 2025
1 parent 5be5baf commit c610a81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,9 @@ fn handle_derive<'a>(
// If the explicitly listed parents define the function, use only ones that are listed. If they
// don't, get it from all of the types parents
let this_func_parents = if selected_parents.iter().any(|p| {
types.get(p.as_ref()).map_or(false, |parent_type| {
parent_type.defines_function(f.as_ref(), functions)
})
types
.get(p.as_ref())
.is_some_and(|parent_type| parent_type.defines_function(f.as_ref(), functions))
}) {
&selected_parents
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3621,7 +3621,7 @@ fn validate_argument_error_handler(
// If this is the associated call we need to do some more digging to give the user a better
// error message.
// Unwraps of func_info are safe in this block because of the false return on map_or
if func_info.map_or(false, |f| f.is_associated_call) {
if func_info.is_some_and(|f| f.is_associated_call) {
let mut error = ErrorItem::make_compile_or_internal_error(
&format!(
"Expected type inheriting {} for associated call",
Expand Down
5 changes: 1 addition & 4 deletions src/internal_rep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,7 @@ impl TypeInfo {
// This is the sexp for *declaring* the type
impl From<&TypeInfo> for Option<sexp::Sexp> {
fn from(typeinfo: &TypeInfo) -> Option<sexp::Sexp> {
let flavor = match typeinfo.get_cil_declaration_type() {
Some(f) => f,
None => return None,
};
let flavor = typeinfo.get_cil_declaration_type()?;
Some(list(&[
atom_s(flavor),
atom_s(typeinfo.name.get_cil_name().as_ref()),
Expand Down

0 comments on commit c610a81

Please sign in to comment.