mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
Update stderr files
This commit is contained in:
parent
86331a46e4
commit
4c8d248190
4 changed files with 17 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
error: called `map(..).flatten()` on an `Iterator`
|
||||
--> $DIR/map_flatten.rs:15:46
|
||||
--> $DIR/map_flatten.rs:16:46
|
||||
|
|
||||
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id)`
|
||||
|
@ -7,31 +7,31 @@ LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().coll
|
|||
= note: `-D clippy::map-flatten` implied by `-D warnings`
|
||||
|
||||
error: called `map(..).flatten()` on an `Iterator`
|
||||
--> $DIR/map_flatten.rs:16:46
|
||||
--> $DIR/map_flatten.rs:17:46
|
||||
|
|
||||
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_ref)`
|
||||
|
||||
error: called `map(..).flatten()` on an `Iterator`
|
||||
--> $DIR/map_flatten.rs:17:46
|
||||
--> $DIR/map_flatten.rs:18:46
|
||||
|
|
||||
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_closure)`
|
||||
|
||||
error: called `map(..).flatten()` on an `Iterator`
|
||||
--> $DIR/map_flatten.rs:18:46
|
||||
--> $DIR/map_flatten.rs:19:46
|
||||
|
|
||||
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(|x| x.checked_add(1))`
|
||||
|
||||
error: called `map(..).flatten()` on an `Iterator`
|
||||
--> $DIR/map_flatten.rs:21:46
|
||||
--> $DIR/map_flatten.rs:22:46
|
||||
|
|
||||
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `.flat_map(|x| 0..x)`
|
||||
|
||||
error: called `map(..).flatten()` on an `Option`
|
||||
--> $DIR/map_flatten.rs:24:39
|
||||
--> $DIR/map_flatten.rs:25:39
|
||||
|
|
||||
LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `.and_then(|x| x)`
|
||||
|
|
|
@ -59,7 +59,7 @@ LL | Struct { x: Option<Option<u8>> },
|
|||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
|
||||
--> $DIR/option_option.rs:78:14
|
||||
--> $DIR/option_option.rs:76:14
|
||||
|
|
||||
LL | foo: Option<Option<Cow<'a, str>>>,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -79,25 +79,25 @@ LL | let _ = stringy.unwrap_or("".to_owned());
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
|
||||
|
||||
error: use of `unwrap_or` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:76:21
|
||||
--> $DIR/or_fun_call.rs:77:21
|
||||
|
|
||||
LL | let _ = Some(1).unwrap_or(map[&1]);
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
|
||||
|
||||
error: use of `unwrap_or` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:78:21
|
||||
--> $DIR/or_fun_call.rs:79:21
|
||||
|
|
||||
LL | let _ = Some(1).unwrap_or(map[&1]);
|
||||
| ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
|
||||
|
||||
error: use of `or` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:102:35
|
||||
--> $DIR/or_fun_call.rs:103:35
|
||||
|
|
||||
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
|
||||
|
||||
error: use of `or` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:106:10
|
||||
--> $DIR/or_fun_call.rs:107:10
|
||||
|
|
||||
LL | .or(Some(Bar(b, Duration::from_secs(2))));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`
|
||||
|
|
|
@ -29,7 +29,7 @@ LL | Err(err)?;
|
|||
| ^^^^^^^^^ help: try this: `return Err(err.into())`
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:86:23
|
||||
--> $DIR/try_err.rs:87:23
|
||||
|
|
||||
LL | Err(_) => Err(1)?,
|
||||
| ^^^^^^^ help: try this: `return Err(1)`
|
||||
|
@ -40,7 +40,7 @@ LL | try_validation!(Ok::<_, i32>(5));
|
|||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:101:23
|
||||
--> $DIR/try_err.rs:102:23
|
||||
|
|
||||
LL | Err(_) => Err(ret_one!())?,
|
||||
| ^^^^^^^^^^^^^^^^ help: try this: `return Err(ret_one!())`
|
||||
|
@ -51,25 +51,25 @@ LL | try_validation_in_macro!(Ok::<_, i32>(5));
|
|||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:140:9
|
||||
--> $DIR/try_err.rs:141:9
|
||||
|
|
||||
LL | Err(foo!())?;
|
||||
| ^^^^^^^^^^^^ help: try this: `return Err(foo!())`
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:147:9
|
||||
--> $DIR/try_err.rs:148:9
|
||||
|
|
||||
LL | Err(io::ErrorKind::WriteZero)?
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `return Poll::Ready(Err(io::ErrorKind::WriteZero.into()))`
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:149:9
|
||||
--> $DIR/try_err.rs:150:9
|
||||
|
|
||||
LL | Err(io::Error::new(io::ErrorKind::InvalidInput, "error"))?
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `return Poll::Ready(Err(io::Error::new(io::ErrorKind::InvalidInput, "error")))`
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:157:9
|
||||
--> $DIR/try_err.rs:158:9
|
||||
|
|
||||
LL | Err(io::ErrorKind::NotFound)?
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `return Poll::Ready(Some(Err(io::ErrorKind::NotFound.into())))`
|
||||
|
|
Loading…
Reference in a new issue