Skip to content

Commit 50d19cf

Browse files
fix(or_fun_call): respect MSRV for Result::unwrap_or_default suggestion (#15756)
Supersedes #14885 Fixes #14876 changelog: [`or_fun_call`]: respect MSRV for `Result::unwrap_or_default` suggestion r? @samueltardieu since you reviewed the original PR, but do feel free to reroll if you're no longer interested
2 parents 3e0590c + 7449d63 commit 50d19cf

File tree

8 files changed

+294
-232
lines changed

8 files changed

+294
-232
lines changed

book/src/lint_configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
883883
* [`needless_borrow`](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow)
884884
* [`non_std_lazy_statics`](https://rust-lang.github.io/rust-clippy/master/index.html#non_std_lazy_statics)
885885
* [`option_as_ref_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref)
886+
* [`or_fun_call`](https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call)
886887
* [`ptr_as_ptr`](https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr)
887888
* [`question_mark`](https://rust-lang.github.io/rust-clippy/master/index.html#question_mark)
888889
* [`redundant_field_names`](https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names)

clippy_config/src/conf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ define_Conf! {
779779
needless_borrow,
780780
non_std_lazy_statics,
781781
option_as_ref_deref,
782+
or_fun_call,
782783
ptr_as_ptr,
783784
question_mark,
784785
redundant_field_names,

clippy_lints/src/methods/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4460,7 +4460,7 @@ declare_clippy_lint! {
44604460
/// Checks for calls to `Read::bytes` on types which don't implement `BufRead`.
44614461
///
44624462
/// ### Why is this bad?
4463-
/// The default implementation calls `read` for each byte, which can be very inefficient for data thats not in memory, such as `File`.
4463+
/// The default implementation calls `read` for each byte, which can be very inefficient for data that's not in memory, such as `File`.
44644464
///
44654465
/// ### Example
44664466
/// ```no_run
@@ -4854,7 +4854,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
48544854
},
48554855
ExprKind::MethodCall(method_call, receiver, args, _) => {
48564856
let method_span = method_call.ident.span;
4857-
or_fun_call::check(cx, expr, method_span, method_call.ident.name, receiver, args);
4857+
or_fun_call::check(cx, expr, method_span, method_call.ident.name, receiver, args, self.msrv);
48584858
expect_fun_call::check(
48594859
cx,
48604860
&self.format_args,

0 commit comments

Comments
 (0)