Commit 73d9ce6
committed
fix(or_fun_call): respect MSRV for unwrap_or_default suggestion
The `unwrap_or_default()` method was introduced in Rust 1.16, but the lint was
suggesting it even when the MSRV was set to 1.15 or lower. This change adds an
MSRV check to ensure we only suggest `unwrap_or_default()` when the MSRV is at
least 1.16.
The fix:
1. Adds MSRV check in `check_unwrap_or_default` using `msrvs::STR_REPEAT` (Rust 1.16)
2. Adds MSRV parameter to the `check` function signature
3. Updates the call site to pass the MSRV parameter
4. Adds `#[allow(clippy::too_many_arguments)]` to handle the linter warning
Fixes #14876 (unwrap_or_default MSRV issue)1 parent 56df855 commit 73d9ce6
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
0 commit comments