about summary refs log tree commit diff
path: root/library/std/src/io
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2021-08-24 16:51:58 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2021-08-24 16:51:58 +0100
commit54df693dd7e6668b78f0636e269f7f928d4932d2 (patch)
treefe2852a647eb01c1c12bc4d36a318d0ae1ea6ec6 /library/std/src/io
parent47ab5f7ce27397310bd8359b8db1504fbf8a9b59 (diff)
downloadrust-54df693dd7e6668b78f0636e269f7f928d4932d2.tar.gz
rust-54df693dd7e6668b78f0636e269f7f928d4932d2.zip
io::Error: alphabeticise the match in as_str()
There was no rationale for the previous ordering.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'library/std/src/io')
-rw-r--r--library/std/src/io/error.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs
index 829ef3d98bb..3f8f34793af 100644
--- a/library/std/src/io/error.rs
+++ b/library/std/src/io/error.rs
@@ -307,13 +307,13 @@ pub enum ErrorKind {
 impl ErrorKind {
     pub(crate) fn as_str(&self) -> &'static str {
         use ErrorKind::*;
+        // Strictly alphabetical, please.  (Sadly rustfmt cannot do this yet.)
         match *self {
             AddrInUse => "address in use",
             AddrNotAvailable => "address not available",
             AlreadyExists => "entity already exists",
             ArgumentListTooLong => "argument list too long",
             BrokenPipe => "broken pipe",
-            ResourceBusy => "resource busy",
             ConnectionAborted => "connection aborted",
             ConnectionRefused => "connection refused",
             ConnectionReset => "connection reset",
@@ -321,9 +321,10 @@ impl ErrorKind {
             Deadlock => "deadlock",
             DirectoryNotEmpty => "directory not empty",
             ExecutableFileBusy => "executable file busy",
+            FileTooLarge => "file too large",
             FilenameTooLong => "filename too long",
+            FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
             FilesystemQuotaExceeded => "filesystem quota exceeded",
-            FileTooLarge => "file too large",
             HostUnreachable => "host unreachable",
             Interrupted => "operation interrupted",
             InvalidData => "invalid data",
@@ -332,16 +333,16 @@ impl ErrorKind {
             NetworkDown => "network down",
             NetworkUnreachable => "network unreachable",
             NotADirectory => "not a directory",
-            StorageFull => "no storage space",
             NotConnected => "not connected",
             NotFound => "entity not found",
+            NotSeekable => "seek on unseekable file",
             Other => "other error",
             OutOfMemory => "out of memory",
             PermissionDenied => "permission denied",
             ReadOnlyFilesystem => "read-only filesystem or storage medium",
+            ResourceBusy => "resource busy",
             StaleNetworkFileHandle => "stale network file handle",
-            FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
-            NotSeekable => "seek on unseekable file",
+            StorageFull => "no storage space",
             TimedOut => "timed out",
             TooManyLinks => "too many links",
             Uncategorized => "uncategorized error",