From c40466e1c27fd89bcdfff04b7d41f7eea397fdf3 Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Mon, 31 Oct 2016 22:55:22 +0000 Subject: [PATCH] Add to docs for if_let_some_result --- clippy_lints/src/ok_if_let.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/ok_if_let.rs b/clippy_lints/src/ok_if_let.rs index 9c086bbcb..09e3fa641 100644 --- a/clippy_lints/src/ok_if_let.rs +++ b/clippy_lints/src/ok_if_let.rs @@ -9,12 +9,21 @@ use utils::{paths, method_chain_args, span_help_and_lint, match_type, snippet}; /// **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,