From ce16b20b677c732094b9533aad6dde9aa1f8f34b Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 10 Nov 2020 18:52:16 +1100 Subject: [PATCH] Slightly clearer docs --- src/errors.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index e0863ef..678fcac 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -96,9 +96,9 @@ pub enum ErrorKind { WrongSizeFrame { expected: usize, found: usize }, /// C API failed to open a file (No return code provided) CouldNotOpen { path: PathBuf, mode: FileMode }, - /// &str could not be converted to &OsStr, probably because it is invalid unicode + /// A path could not be converted to &OsStr, probably because it is invalid unicode InvalidOsStr, - /// &OsStr could not be converted to &CStr because it had a null byte + /// A path could not be converted to &CStr because it had a null byte NullInStr(std::ffi::NulError), } @@ -146,8 +146,8 @@ impl std::fmt::Display for ErrorKind { CouldNotOpen { path, mode } => { write!(f, "Could not open file at {:?} in mode {:?}", path, mode) } - InvalidOsStr => write!(f, "CStr must be valid unicode on this platform"), - NullInStr(_err) => write!(f, "CStr cannot include null bytes"), + InvalidOsStr => write!(f, "Paths must be valid unicode on this platform"), + NullInStr(_err) => write!(f, "Paths cannot include null bytes"), } } }