Created
December 14, 2013 13:15
-
-
Save killerswan/7959007 to your computer and use it in GitHub Desktop.
pattern confusion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn is_file(path: &str) -> bool { | |
| let p = Path::new(path); | |
| match io::result(|| std::io::fs::stat(&p)) { | |
| Ok(stat) => { | |
| match stat.kind { | |
| TypeFile => { return true; } | |
| _ => { return false; } | |
| } | |
| } | |
| Err(e) => { return false; } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rustc -o ./bin/testloop-rs --bin --opt-level=0 src/testloop-rs.rs | |
| src/testloop-rs.rs:61:12: 61:13 error: unreachable pattern | |
| src/testloop-rs.rs:61 _ => { return false; } | |
| ^ | |
| error: aborting due to previous error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment