Skip to content

Commit 2fea2cd

Browse files
authored
Update document for std::io::Error::downcast
1 parent df15a2a commit 2fea2cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

std/src/io/error.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -852,15 +852,15 @@ 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`] when this 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`].
862863
///
863-
/// [`new`]: Error::new
864864
///
865865
/// # Examples
866866
///

0 commit comments

Comments
 (0)