Skip to content

Commit efdf008

Browse files
brauliobzehuss
authored andcommitted
Added links and fixed compiler erros
1 parent 0003310 commit efdf008

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/expressions/if-expr.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ assert_eq!(y, "Bigger");
4444

4545
> **<sup>Syntax</sup>**\
4646
> _IfLetExpression_ :\
47-
> &nbsp;&nbsp; `if` `let` _Pattern_ `=` [_Expression_]<sub>_except struct expression_</sub>
47+
> &nbsp;&nbsp; `if` `let` [_Pattern_] `=` [_Expression_]<sub>_except struct expression_</sub>
4848
> [_BlockExpression_]\
4949
> &nbsp;&nbsp; (`else` (
5050
> [_BlockExpression_]
@@ -113,3 +113,4 @@ match EXPR {
113113

114114
[_Expression_]: expressions.html
115115
[_BlockExpression_]: expressions/block-expr.html
116+
[_Pattern_]: patterns.html

src/expressions/loop-expr.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ while i < 10 {
6767

6868
> **<sup>Syntax</sup>**\
6969
> [_PredicatePatternLoopExpression_] :\
70-
> &nbsp;&nbsp; `while` `let` _Pattern_ `=` [_Expression_]<sub>except struct expression</sub>
70+
> &nbsp;&nbsp; `while` `let` [_Pattern_] `=` [_Expression_]<sub>except struct expression</sub>
7171
> [_BlockExpression_]
7272
7373
A `while let` loop is semantically similar to a `while` loop but in place of a
@@ -271,5 +271,6 @@ expression `()`.
271271

272272
[_Expression_]: expressions.html
273273
[_BlockExpression_]: expressions/block-expr.html
274+
[_Pattern_]: patterns.html
274275

275276
[LIFETIME_OR_LABEL]: tokens.html#lifetimes-and-loop-labels

src/patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ let arr = [1, 2, 3];
553553
match arr {
554554
[1, _, _] => "starts with one",
555555
[a, b, c] => "starts with something else",
556-
}
556+
};
557557
```
558558
```rust
559559
// Dynamic size
@@ -562,7 +562,7 @@ match v[..] {
562562
[a, b] => { /* this arm will not apply because the length doesn't match */ }
563563
[a, b, c] => { /* this arm will apply */ }
564564
_ => { /* this wildcard is required, since we don't know length statically */ }
565-
}
565+
};
566566
```
567567

568568
## Path patterns

0 commit comments

Comments
 (0)