Update Examples
parent
5a2bb177a3
commit
f42cb5718c
25
Examples.md
25
Examples.md
@ -833,11 +833,36 @@ fn main
|
||||
<td>
|
||||
|
||||
```
|
||||
fn main() {
|
||||
let mut counter = 0;
|
||||
|
||||
let result = loop {
|
||||
counter += 1;
|
||||
|
||||
if counter == 10 {
|
||||
break counter * 2;
|
||||
}
|
||||
};
|
||||
|
||||
assert_eq!(result, 20);
|
||||
}
|
||||
```
|
||||
</td><td>
|
||||
|
||||
```
|
||||
fn main
|
||||
let mut counter = 0
|
||||
|
||||
let result = loop
|
||||
counter += 1
|
||||
|
||||
if counter == 10 then break counter * 2
|
||||
|
||||
assert_eq! result, 20)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
</td></tr></table>
|
||||
|
Loading…
Reference in New Issue
Block a user