mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Remove use of try!
from documentation
This commit is contained in:
parent
fddc9801dd
commit
1102b87e3a
@ -65,7 +65,7 @@ declare_clippy_lint! {
|
|||||||
///
|
///
|
||||||
/// **Why is this bad?** `result.unwrap()` will let the thread panic on `Err`
|
/// **Why is this bad?** `result.unwrap()` will let the thread panic on `Err`
|
||||||
/// values. Normally, you want to implement more sophisticated error handling,
|
/// values. Normally, you want to implement more sophisticated error handling,
|
||||||
/// and propagate errors upwards with `try!`.
|
/// and propagate errors upwards with `?` operator.
|
||||||
///
|
///
|
||||||
/// Even if you want to panic on errors, not all `Error`s implement good
|
/// Even if you want to panic on errors, not all `Error`s implement good
|
||||||
/// messages on display. Therefore, it may be beneficial to look at the places
|
/// messages on display. Therefore, it may be beneficial to look at the places
|
||||||
@ -127,7 +127,7 @@ declare_clippy_lint! {
|
|||||||
///
|
///
|
||||||
/// **Why is this bad?** `result.expect()` will let the thread panic on `Err`
|
/// **Why is this bad?** `result.expect()` will let the thread panic on `Err`
|
||||||
/// values. Normally, you want to implement more sophisticated error handling,
|
/// values. Normally, you want to implement more sophisticated error handling,
|
||||||
/// and propagate errors upwards with `try!`.
|
/// and propagate errors upwards with `?` operator.
|
||||||
///
|
///
|
||||||
/// **Known problems:** None.
|
/// **Known problems:** None.
|
||||||
///
|
///
|
||||||
|
@ -15,18 +15,18 @@ declare_clippy_lint! {
|
|||||||
///
|
///
|
||||||
/// **Example:**
|
/// **Example:**
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// for result in iter {
|
/// for i in iter {
|
||||||
/// if let Some(bench) = try!(result).parse().ok() {
|
/// if let Some(value) = i.parse().ok() {
|
||||||
/// vec.push(bench)
|
/// vec.push(value)
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
/// Could be written:
|
/// Could be written:
|
||||||
///
|
///
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// for result in iter {
|
/// for i in iter {
|
||||||
/// if let Ok(bench) = try!(result).parse() {
|
/// if let Ok(value) = i.parse() {
|
||||||
/// vec.push(bench)
|
/// vec.push(value)
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user