Continue return never type compile error

⚓ rust    📅 2025-05-17    👤 surdeus    👁️ 4      

surdeus

Warning

This post was published 44 days ago. The information described in this article may have changed.
        let guess: u32 = match guess.trim().parse() {
            Ok(num) => num,
            Err(_) => continue,
        };

this code is from Advanced Types - The Rust Programming Language

image

when i copy this code into rustrover, the ide tells me compile error: "continue can obly be used inside a loop/while block".
WHY?
image

4 posts - 3 participants

Read full topic

🏷️ rust_feed