Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vohoanglong0107 committed Apr 28, 2024
1 parent 2cd2083 commit 7f4be12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4113,6 +4113,8 @@ declare_clippy_lint! {
suspicious,
"is_empty() called on strings known at compile time"
}

#[allow(clippy::struct_excessive_bools)]
pub struct Methods {
avoid_breaking_exported_api: bool,
msrv: Msrv,
Expand All @@ -4124,6 +4126,7 @@ pub struct Methods {

impl Methods {
#[must_use]
#[allow(clippy::fn_params_excessive_bools)]
pub fn new(
avoid_breaking_exported_api: bool,
msrv: Msrv,
Expand Down Expand Up @@ -4570,7 +4573,7 @@ impl Methods {
_ => {},
},
("min" | "max", [arg]) => {
unnecessary_min_or_max::check(cx, expr, name, recv, arg, self.allowed_external_crates)
unnecessary_min_or_max::check(cx, expr, name, recv, arg, self.allowed_external_crates);
},
("drain", ..) => {
if let Node::Stmt(Stmt { hir_id: _, kind, .. }) = cx.tcx.parent_hir_node(expr.hir_id)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/unnecessary_min_or_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn detect_extrema<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<
}
}

fn is_external_const<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>) -> bool {
fn is_external_const(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
let ExprKind::Path(ref qpath) = expr.kind else {
return false;
};
Expand Down

0 comments on commit 7f4be12

Please sign in to comment.