1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-02-04 10:09:29 +02:00

Merge pull request #123 from ilyagr/username_or_error

Error handling: clarify printing of Result
This commit is contained in:
Martin Geisler 2023-01-10 10:21:43 +01:00 committed by GitHub
commit e29c3bfb99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -46,6 +46,6 @@ fn read_username(path: &str) -> Result<String, ReadUsernameError> {
fn main() {
//fs::write("config.dat", "").unwrap();
let username = read_username("config.dat");
println!("username: {username:?}");
println!("username or error: {username:?}");
}
```

View File

@ -41,6 +41,6 @@ fn read_username(path: &str) -> Result<String, io::Error> {
fn main() {
//fs::write("config.dat", "alice").unwrap();
let username = read_username("config.dat");
println!("username: {username:?}");
println!("username or error: {username:?}");
}
```