File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -198,8 +198,6 @@ fn main() {
198198 let _ = res. map_or ( 1 , |a| a + 1 ) ;
199199 let _ = res. map_or ( 1 , |a| a + 1 ) ;
200200 let _ = res. map_or ( 5 , |a| a + 1 ) ;
201- issue10729::reproduce(&None);
202- issue10729::reproduce2(&mut None);
203201}
204202
205203#[ allow( dead_code) ]
@@ -212,7 +210,7 @@ fn issue9742() -> Option<&'static str> {
212210}
213211
214212mod issue10729 {
215- #![allow(clippy::unit_arg)]
213+ #![ allow( clippy:: unit_arg, dead_code ) ]
216214
217215 pub fn reproduce ( initial : & Option < String > ) {
218216 // 👇 needs `.as_ref()` because initial is an `&Option<_>`
Original file line number Diff line number Diff line change @@ -239,8 +239,6 @@ fn main() {
239239 Ok ( a) => a + 1 ,
240240 } ;
241241 let _ = if let Ok ( a) = res { a + 1 } else { 5 } ;
242- issue10729:: reproduce ( & None ) ;
243- issue10729:: reproduce2 ( & mut None ) ;
244242}
245243
246244#[ allow( dead_code) ]
@@ -253,7 +251,7 @@ fn issue9742() -> Option<&'static str> {
253251}
254252
255253mod issue10729 {
256- #![ allow( clippy:: unit_arg) ]
254+ #![ allow( clippy:: unit_arg, dead_code ) ]
257255
258256 pub fn reproduce ( initial : & Option < String > ) {
259257 // 👇 needs `.as_ref()` because initial is an `&Option<_>`
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ LL | let _ = if let Ok(a) = res { a + 1 } else { 5 };
272272 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `res.map_or(5, |a| a + 1)`
273273
274274error: use Option::map_or instead of an if let/else
275- --> $DIR/option_if_let_else.rs:260 :9
275+ --> $DIR/option_if_let_else.rs:258 :9
276276 |
277277LL | / match initial {
278278LL | | Some(value) => do_something(value),
@@ -281,7 +281,7 @@ LL | | }
281281 | |_________^ help: try: `initial.as_ref().map_or({}, |value| do_something(value))`
282282
283283error: use Option::map_or instead of an if let/else
284- --> $DIR/option_if_let_else.rs:267 :9
284+ --> $DIR/option_if_let_else.rs:265 :9
285285 |
286286LL | / match initial {
287287LL | | Some(value) => do_something2(value),
You can’t perform that action at this time.
0 commit comments