error: use of `unwrap_or` followed by a function call
--> $DIR/methods.rs:326:5
|
326 | without_default.unwrap_or(Foo::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(or_fun_call)] implied by #[deny(clippy)]
help: try this
| without_default.unwrap_or_else(Foo::new);
error: use of `or_insert` followed by a function call
--> $DIR/methods.rs:332:5
|
332 | map.entry(42).or_insert(String::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(or_fun_call)] implied by #[deny(clippy)]
help: try this
| map.entry(42).or_insert_with(String::new);
error: use of `or_insert` followed by a function call
--> $DIR/methods.rs:338:5
|
338 | btree.entry(42).or_insert(String::new());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(or_fun_call)] implied by #[deny(clippy)]
help: try this
| btree.entry(42).or_insert_with(String::new);
error: use of `unwrap_or` followed by a function call
--> $DIR/methods.rs:344:13
|
344 | let _ = stringy.unwrap_or("".to_owned());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(or_fun_call)] implied by #[deny(clippy)]
help: try this
| let _ = stringy.unwrap_or_else(|| "".to_owned());
error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
--> $DIR/methods.rs:358:23
|
358 | let bad_vec = some_vec.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/methods.rs:5:9
|
5 | #![deny(clippy, clippy_pedantic)]
| ^^^^^^
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
--> $DIR/methods.rs:360:26
|
360 | let bad_slice = &some_vec[..].iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
error: called `.iter().nth()` on a slice. Calling `.get()` is both faster and more readable
--> $DIR/methods.rs:362:31
|
362 | let bad_boxed_slice = boxed_slice.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
error: called `.iter().nth()` on a VecDeque. Calling `.get()` is both faster and more readable
--> $DIR/methods.rs:364:29
|
364 | let bad_vec_deque = some_vec_deque.iter().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
error: called `.iter_mut().nth()` on a Vec. Calling `.get_mut()` is both faster and more readable
--> $DIR/methods.rs:370:23
|
370 | let bad_vec = some_vec.iter_mut().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
error: called `.iter_mut().nth()` on a slice. Calling `.get_mut()` is both faster and more readable
--> $DIR/methods.rs:374:26
|
374 | let bad_slice = &some_vec[..].iter_mut().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
error: called `.iter_mut().nth()` on a VecDeque. Calling `.get_mut()` is both faster and more readable
--> $DIR/methods.rs:378:29
|
378 | let bad_vec_deque = some_vec_deque.iter_mut().nth(3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_nth)] implied by #[deny(clippy)]
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
--> $DIR/methods.rs:392:13
|
392 | let _ = some_vec.iter().skip(42).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_skip_next)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/methods.rs:5:9
|
5 | #![deny(clippy, clippy_pedantic)]
| ^^^^^^
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
--> $DIR/methods.rs:395:13
|
395 | let _ = some_vec.iter().cycle().skip(42).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_skip_next)] implied by #[deny(clippy)]
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
--> $DIR/methods.rs:398:13
|
398 | let _ = (1..10).skip(10).next();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_skip_next)] implied by #[deny(clippy)]
error: called `skip(x).next()` on an iterator. This is more succinctly expressed by calling `nth(x)`
--> $DIR/methods.rs:401:14
|
401 | let _ = &some_vec[..].iter().skip(3).next();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(iter_skip_next)] implied by #[deny(clippy)]
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/methods.rs:429:17
|
429 | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
note: lint level defined here
--> $DIR/methods.rs:5:9
|
5 | #![deny(clippy, clippy_pedantic)]
| ^^^^^^
help: try this
| let _ = &boxed_slice[1];
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/methods.rs:433:17
|
433 | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| let _ = &some_slice[0];
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/methods.rs:437:17
|
437 | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| let _ = &some_vec[0];
error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/methods.rs:441:17
|
441 | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| let _ = &some_vecdeque[0];
error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
--> $DIR/methods.rs:445:17
|
445 | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| let _ = &some_hashmap[&1];
error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
--> $DIR/methods.rs:449:17
|
449 | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| let _ = &some_btreemap[&1];
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/methods.rs:458:10
|
458 | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| *&mut boxed_slice[0] = 1;
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/methods.rs:462:10
|
462 | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| *&mut some_slice[0] = 1;
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/methods.rs:466:10
|
466 | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| *&mut some_vec[0] = 1;
error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/methods.rs:470:10
|
470 | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[deny(get_unwrap)] implied by #[deny(clippy)]
help: try this
| *&mut some_vecdeque[0] = 1;
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message