mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Update if-let.md
This commit is contained in:
parent
ebf07da0a5
commit
fb7f211c0c
@ -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, let’s say we have some sort of `Option<T>`. We want to call a function
|
For example, let’s say we have some sort of `Option<T>`. We want to call a function
|
||||||
|
Loading…
Reference in New Issue
Block a user