ErrorKind is safe to classify; arbitrary OS error messages are not.
(kind: ErrorKind)
| 315 | |
| 316 | /// ErrorKind is safe to classify; arbitrary OS error messages are not. |
| 317 | fn io_summary(kind: ErrorKind) -> &'static str { |
| 318 | match kind { |
| 319 | ErrorKind::NotFound => "not found", |
| 320 | ErrorKind::PermissionDenied => "permission denied", |
| 321 | ErrorKind::InvalidData => "invalid data or encoding", |
| 322 | ErrorKind::IsADirectory => "is a directory", |
| 323 | ErrorKind::NotADirectory => "a path component is not a directory", |
| 324 | _ => "I/O error", |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | // A dangling symlink or a concurrent replacement is not proof of absence. |
| 329 | fn demonstrably_missing(path: &Path) -> bool { |
nothing calls this directly
no outgoing calls
no test coverage detected