We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73e16a5 commit e41ea31Copy full SHA for e41ea31
1 file changed
courses/rust_essentials/200_error_handling/07-thiserror.rst
@@ -121,15 +121,15 @@ Why Use "thiserror"?
121
#[error("Environment variable {0} not set")]
122
ConfigError(String),
123
124
- #[error("File system error")] // Automatically wraps io::Error
+ #[error("File system error")] // Automatically wraps 'io::Error'
125
IoError(#[from] std::io::Error),
126
}
127
128
fn main() -> Result<(), MyError> {
129
// 1. Manual error creation
130
let _ = Err(MyError::ConfigError("PORT".into()))?;
131
132
- // 2. Automatic conversion using ? (this returns IoError)
+ // 2. Automatic conversion using '?' (this returns 'IoError')
133
let _f = File::open("missing.txt")?;
134
135
Ok(())
0 commit comments