mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-01 23:29:38 +02:00
Split complex enum initialization (#2667)
This commit is contained in:
parent
fdb0a398b1
commit
8b04a6dcb0
@ -22,7 +22,8 @@ enum PlayerMove {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let player_move: PlayerMove = PlayerMove::Run(Direction::Left);
|
||||
let dir = Direction::Left;
|
||||
let player_move: PlayerMove = PlayerMove::Run(dir);
|
||||
println!("On this turn: {player_move:?}");
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user