Skip to content

Commit 54df693

Browse files
committed
io::Error: alphabeticise the match in as_str()
There was no rationale for the previous ordering. Signed-off-by: Ian Jackson <[email protected]>
1 parent 47ab5f7 commit 54df693

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: library/std/src/io/error.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -307,23 +307,24 @@ pub enum ErrorKind {
307307
impl ErrorKind {
308308
pub(crate) fn as_str(&self) -> &'static str {
309309
use ErrorKind::*;
310+
// Strictly alphabetical, please. (Sadly rustfmt cannot do this yet.)
310311
match *self {
311312
AddrInUse => "address in use",
312313
AddrNotAvailable => "address not available",
313314
AlreadyExists => "entity already exists",
314315
ArgumentListTooLong => "argument list too long",
315316
BrokenPipe => "broken pipe",
316-
ResourceBusy => "resource busy",
317317
ConnectionAborted => "connection aborted",
318318
ConnectionRefused => "connection refused",
319319
ConnectionReset => "connection reset",
320320
CrossesDevices => "cross-device link or rename",
321321
Deadlock => "deadlock",
322322
DirectoryNotEmpty => "directory not empty",
323323
ExecutableFileBusy => "executable file busy",
324+
FileTooLarge => "file too large",
324325
FilenameTooLong => "filename too long",
326+
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
325327
FilesystemQuotaExceeded => "filesystem quota exceeded",
326-
FileTooLarge => "file too large",
327328
HostUnreachable => "host unreachable",
328329
Interrupted => "operation interrupted",
329330
InvalidData => "invalid data",
@@ -332,16 +333,16 @@ impl ErrorKind {
332333
NetworkDown => "network down",
333334
NetworkUnreachable => "network unreachable",
334335
NotADirectory => "not a directory",
335-
StorageFull => "no storage space",
336336
NotConnected => "not connected",
337337
NotFound => "entity not found",
338+
NotSeekable => "seek on unseekable file",
338339
Other => "other error",
339340
OutOfMemory => "out of memory",
340341
PermissionDenied => "permission denied",
341342
ReadOnlyFilesystem => "read-only filesystem or storage medium",
343+
ResourceBusy => "resource busy",
342344
StaleNetworkFileHandle => "stale network file handle",
343-
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
344-
NotSeekable => "seek on unseekable file",
345+
StorageFull => "no storage space",
345346
TimedOut => "timed out",
346347
TooManyLinks => "too many links",
347348
Uncategorized => "uncategorized error",

0 commit comments

Comments
 (0)