Rename loop label (#342)

pull/348/head
Marco Ieni 1 year ago committed by GitHub
parent 87373fa34d
commit 8949bcd433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,17 +25,17 @@ pub struct SendError(String);
fn main() { fn main() {
let mut value = "imagine this is very long string".to_string(); let mut value = "imagine this is very long string".to_string();
let success = 'send: { let success = 's: {
// Try to send value two times. // Try to send value two times.
for _ in 0..2 { for _ in 0..2 {
value = match send(value) { value = match send(value) {
Ok(()) => break 'send true, Ok(()) => break 's true,
Err(SendError(value)) => value, Err(SendError(value)) => value,
} }
} }
false false
}; };
println!("success: {}", success); println!("success: {}", success);
} }
``` ```

Loading…
Cancel
Save