Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- enum Packet {
- Sample{number: u64, total: u64, send_time: u64, core: u16},
- }
- fn main() {
- let mut a = Packet::Sample{
- number: 0,
- total: 0,
- send_time: 0,
- core: 0,
- };
- match a {
- Packet::Sample {
- ref mut number,
- ref mut total,
- ..
- } => {
- *number = 1;
- *total = 2;
- },
- }
- println!("a: {:?}", a);
- }
Add Comment
Please, Sign In to add comment