Merge pull request #1311 from gibfahn/if_let_some_result

Add to docs for if_let_some_result
This commit is contained in:
Manish Goregaokar 2016-10-31 16:02:17 -07:00 committed by GitHub
commit 0e1f065678

View file

@ -9,13 +9,22 @@ 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,
Warn,