File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ pub enum ErrorKind {
370
370
371
371
// "Unusual" error kinds which do not correspond simply to (sets
372
372
// of) OS error codes, should be added just above this comment.
373
- // `Other` and `Uncategorised ` should remain at the end:
373
+ // `Other` and `Uncategorized ` should remain at the end:
374
374
//
375
375
/// A custom error that does not fall under any other I/O error kind.
376
376
///
@@ -882,6 +882,13 @@ impl Error {
882
882
883
883
/// Returns the corresponding [`ErrorKind`] for this error.
884
884
///
885
+ /// This may be a value set by Rust code constructing custom `io::Error`s,
886
+ /// or if this `io::Error` was sourced from the operating system,
887
+ /// it will be a value inferred from the system's error encoding.
888
+ /// See [`last_os_error`] for more details.
889
+ ///
890
+ /// [`last_os_error`]: Error::last_os_error
891
+ ///
885
892
/// # Examples
886
893
///
887
894
/// ```
@@ -892,7 +899,8 @@ impl Error {
892
899
/// }
893
900
///
894
901
/// fn main() {
895
- /// // Will print "Uncategorized".
902
+ /// // As no error has (visibly) occurred, this may print anything!
903
+ /// // It likely prints a placeholder for unidentified (non-)errors.
896
904
/// print_error(Error::last_os_error());
897
905
/// // Will print "AddrInUse".
898
906
/// print_error(Error::new(ErrorKind::AddrInUse, "oh no!"));
You can’t perform that action at this time.
0 commit comments