Commit 56df855
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
Fixes #14876 (unwrap_or_default MSRV issue)1 parent 24a2a66 commit 56df855
2 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4412 | 4412 | | |
4413 | 4413 | | |
4414 | 4414 | | |
4415 | | - | |
| 4415 | + | |
4416 | 4416 | | |
4417 | 4417 | | |
4418 | 4418 | | |
| |||
4741 | 4741 | | |
4742 | 4742 | | |
4743 | 4743 | | |
4744 | | - | |
| 4744 | + | |
4745 | 4745 | | |
4746 | 4746 | | |
4747 | 4747 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
42 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
218 | | - | |
| 226 | + | |
219 | 227 | | |
220 | 228 | | |
221 | 229 | | |
222 | | - | |
| 230 | + | |
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
| |||
0 commit comments