Created
March 25, 2025 08:45
-
-
Save BornPsych/e7062a0eac9d0b34ca013ecf6c6a9cd2 to your computer and use it in GitHub Desktop.
Rust Error file quick start
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
| pub type Result<T> = core::result::Result<T, Error>; | |
| #[derive(Debug)] | |
| pub enum Error {} | |
| // region: --- Error Boilerplate | |
| impl core::fmt::Display for Error { | |
| fn fmt( | |
| &self, | |
| fmt: &mut core::fmt::Formatter, | |
| ) -> core::result::Result<(), core::fmt::Error> { | |
| write!(fmt, "{self:?}") | |
| } | |
| } | |
| impl std::error::Error for Error {} | |
| // endregion: --- Error Boilerplate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment