Skip to content

Commit e41ea31

Browse files
frank-at-adacoreDana Binkley
andcommitted
Apply 2 suggestion(s) to 1 file(s)
Co-authored-by: Dana Binkley <binkley@adacore.com>
1 parent 73e16a5 commit e41ea31

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

courses/rust_essentials/200_error_handling/07-thiserror.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ Why Use "thiserror"?
121121
#[error("Environment variable {0} not set")]
122122
ConfigError(String),
123123
124-
#[error("File system error")] // Automatically wraps io::Error
124+
#[error("File system error")] // Automatically wraps 'io::Error'
125125
IoError(#[from] std::io::Error),
126126
}
127127
128128
fn main() -> Result<(), MyError> {
129129
// 1. Manual error creation
130130
let _ = Err(MyError::ConfigError("PORT".into()))?;
131131
132-
// 2. Automatic conversion using ? (this returns IoError)
132+
// 2. Automatic conversion using '?' (this returns 'IoError')
133133
let _f = File::open("missing.txt")?;
134134
135135
Ok(())

0 commit comments

Comments
 (0)