Update if-let.md

This commit is contained in:
bluecereal 2017-02-05 20:20:43 -05:00 committed by GitHub
parent ebf07da0a5
commit fb7f211c0c

View File

@ -1,7 +1,7 @@
% if let % if let
`if let` allows us to match [patterns][patterns] within the condition of an [if][if]. `if let` permits [patterns][pattern] matching within the condition of an [if][if] statement.
As a consequence, we reduce the overhead of certain kinds of [pattern][patterns] matches This allows us to reduce the overhead of certain kinds of [pattern][patterns] matches
and express them in a more convenient way. and express them in a more convenient way.
For example, lets say we have some sort of `Option<T>`. We want to call a function For example, lets say we have some sort of `Option<T>`. We want to call a function