Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy warnings in clippy 1.85 #277

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading