Add to docs for if_let_some_result
This commit is contained in:
parent
053896b678
commit
c40466e1c2
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user