diff --git a/src/error/multiple_error_types/boxing_errors.md b/src/error/multiple_error_types/boxing_errors.md index e2eb68607e..b0fc2aa3ec 100644 --- a/src/error/multiple_error_types/boxing_errors.md +++ b/src/error/multiple_error_types/boxing_errors.md @@ -13,7 +13,7 @@ use std::error; use std::fmt; // Change the alias to `Box`. -type Result = std::result::Result>; +type Result = std::result::Result>; #[derive(Debug, Clone)] struct EmptyVec; @@ -29,7 +29,7 @@ impl error::Error for EmptyVec { "invalid first item to double" } - fn cause(&self) -> Option<&error::Error> { + fn cause(&self) -> Option<&(dyn error::Error)> { // Generic error, underlying cause isn't tracked. None }