From: Gibson Fahnestock Date: Mon, 31 Oct 2016 22:55:22 +0000 (+0000) Subject: Add to docs for if_let_some_result X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=c40466e1c27fd89bcdfff04b7d41f7eea397fdf3;p=rust.git Add to docs for if_let_some_result --- diff --git a/clippy_lints/src/ok_if_let.rs b/clippy_lints/src/ok_if_let.rs index 9c086bbcbf4..09e3fa641f9 100644 --- a/clippy_lints/src/ok_if_let.rs +++ b/clippy_lints/src/ok_if_let.rs @@ -9,12 +9,21 @@ /// **Known problems:** None. /// /// **Example:** -/// ```rustc +/// ```rust /// for result in iter { /// if let Some(bench) = try!(result).parse().ok() { /// vec.push(bench) /// } /// } +///``` +/// Could be written: +/// +/// ```rust +/// for result in iter { +/// if let Ok(bench) = try!(result).parse() { +/// vec.push(bench) +/// } +/// } /// ``` declare_lint! { pub IF_LET_SOME_RESULT,