From d379884d611f06c0a86b82da22b13913da483a7b Mon Sep 17 00:00:00 2001 From: LiYilong <1532139562@qq.com> Date: Sun, 22 Mar 2026 01:18:36 +0800 Subject: [PATCH] fix(ch19): use id_variable in listing 19-29 --- .../ch19-patterns-and-matching/listing-19-29/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/listings/ch19-patterns-and-matching/listing-19-29/src/main.rs b/listings/ch19-patterns-and-matching/listing-19-29/src/main.rs index 325af305..3c5551e5 100644 --- a/listings/ch19-patterns-and-matching/listing-19-29/src/main.rs +++ b/listings/ch19-patterns-and-matching/listing-19-29/src/main.rs @@ -7,8 +7,10 @@ fn main() { let msg = Message::Hello { id: 5 }; match msg { - Message::Hello { id: id @ 3..=7 } => { - println!("Found an id in range: {id}") + Message::Hello { + id: id_variable @ 3..=7, + } => { + println!("Found an id in range: {id_variable}") } Message::Hello { id: 10..=12 } => { println!("Found an id in another range")