Skip to content

Commit

Permalink
Merge #528
Browse files Browse the repository at this point in the history
528: Fix pattern examples r=Veykril a=Nadrieril



Co-authored-by: Nadrieril <[email protected]>
  • Loading branch information
bors-ferrocene[bot] and Nadrieril authored Oct 28, 2024
2 parents f38f22b + cdc7880 commit d5472d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ A :t:`refutable constant` is a :t:`constant` of a :t:`refutable type`.
.. rubric:: Examples

:dp:`fls_sgu9bnp7xajv`
``x`` is an :t:`irrefutable pattern` because it always matches ``42``.
``x`` is an :t:`irrefutable pattern` because it matches all possible values of type ``i32``.

.. code-block:: rust
let x = 42;
:dp:`fls_cl1g4fxfa020`
``y`` is a :t:`refutable pattern` because it does not match ``value`` when
``core::option::Option::Some(y)`` is a :t:`refutable pattern` because it does not match ``value`` when
``value`` denotes :std:`core::option::Option::None`.

.. code-block:: rust
Expand Down Expand Up @@ -708,7 +708,7 @@ A slice pattern in the context of a match expression.

.. syntax::

match v {
match v.as_slice() {
[a, b, c] => (),
_ => ()
}
Expand Down

0 comments on commit d5472d9

Please sign in to comment.