File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -852,15 +852,19 @@ impl Error {
852852 }
853853 }
854854
855- /// Attempt to downcast the inner error to `E` if any .
855+ /// Attempt to downcast the custom boxed error to `E`.
856856 ///
857- /// If this [`Error`] was constructed via [`new`] then this function will
858- /// attempt to perform downgrade on it, otherwise it will return [`Err`].
857+ /// If this [`Error`] contains a custom boxed error,
858+ /// then it would attempt downcasting on the boxed error,
859+ /// otherwise it will return [`Err`].
859860 ///
860- /// If the downcast succeeds, it will return [`Ok`], otherwise it will also
861- /// return [`Err`].
861+ /// If the custom boxed error has the same type as `E`, it will return [`Ok`],
862+ /// otherwise it will also return [`Err`].
863+ ///
864+ /// This method is meant to be a convenience routine for calling
865+ /// `Box<dyn Error + Sync + Send>::downcast` on the custom boxed error, returned by
866+ /// [`Error::into_inner`].
862867 ///
863- /// [`new`]: Error::new
864868 ///
865869 /// # Examples
866870 ///
You can’t perform that action at this time.
0 commit comments