1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-06 09:37:27 +02:00

Split complex enum initialization (#2667)

This commit is contained in:
Nicole L 2025-02-27 12:32:28 -08:00 committed by GitHub
parent fdb0a398b1
commit 8b04a6dcb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,7 +22,8 @@ enum PlayerMove {
} }
fn main() { 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:?}"); println!("On this turn: {player_move:?}");
} }
``` ```