update rust
This commit is contained in:
parent
0b22ef1121
commit
4eb5170941
1 changed files with 7 additions and 0 deletions
|
@ -148,6 +148,13 @@ fn add_two(a: isize) -> isize {
|
|||
}
|
||||
```
|
||||
|
||||
The default return type of a function is the Unit Type `()`. You can also signal that a function will never return with `!`
|
||||
```rust
|
||||
fn infinity() -> ! {
|
||||
loop {}
|
||||
}
|
||||
```
|
||||
|
||||
### Enums
|
||||
Rust has enums which can even hold some data.
|
||||
```rust
|
||||
|
|
Loading…
Reference in a new issue