/// }
///
/// impl Error for SuperError {
- /// fn description(&self) -> &str {
- /// "I'm the superhero of errors"
- /// }
- ///
/// fn cause(&self) -> Option<&dyn Error> {
/// Some(&self.side)
/// }
/// }
/// }
///
- /// impl Error for SuperErrorSideKick {
- /// fn description(&self) -> &str {
- /// "I'm SuperError side kick"
- /// }
- /// }
+ /// impl Error for SuperErrorSideKick {}
///
/// fn get_super_error() -> Result<(), SuperError> {
/// Err(SuperError { side: SuperErrorSideKick })
/// }
///
/// impl Error for SuperError {
- /// fn description(&self) -> &str {
- /// "I'm the superhero of errors"
- /// }
- ///
/// fn source(&self) -> Option<&(dyn Error + 'static)> {
/// Some(&self.side)
/// }
/// }
/// }
///
- /// impl Error for SuperErrorSideKick {
- /// fn description(&self) -> &str {
- /// "I'm SuperError side kick"
- /// }
- /// }
+ /// impl Error for SuperErrorSideKick {}
///
/// fn get_super_error() -> Result<(), SuperError> {
/// Err(SuperError { side: SuperErrorSideKick })
/// }
/// }
///
- /// impl Error for AnError {
- /// fn description(&self) -> &str {
- /// "Description of an error"
- /// }
- /// }
+ /// impl Error for AnError {}
///
/// let an_error = AnError;
/// assert!(0 == mem::size_of_val(&an_error));
/// }
/// }
///
- /// impl Error for AnError {
- /// fn description(&self) -> &str {
- /// "Description of an error"
- /// }
- /// }
+ /// impl Error for AnError {}
///
/// unsafe impl Send for AnError {}
///