From 2daa1b75309be4c98e5614d2fac089b246d6ba79 Mon Sep 17 00:00:00 2001 From: diaphore Date: Thu, 6 Aug 2015 22:44:50 +0200 Subject: Trim trailing newline from FormatMessageW --- src/libstd/sys/windows/os.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index 8a8cf9e7c53..694d873d0d2 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -84,9 +84,13 @@ pub fn error_string(errnum: i32) -> String { } let b = buf.iter().position(|&b| b == 0).unwrap_or(buf.len()); - let msg = String::from_utf16(&buf[..b]); - match msg { - Ok(msg) => msg, + match String::from_utf16(&buf[..b]) { + Ok(mut msg) => { + // Trim trailing CRLF inserted by FormatMessageW + let len = msg.trim_right().len(); + msg.truncate(len); + msg + }, Err(..) => format!("OS Error {} (FormatMessageW() returned \ invalid UTF-16)", errnum), } -- cgit 1.4.1-3-g733a5 From 3b686a3ffb49a0d28bf3fee9cb922ff0a9f58c8a Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 10 Aug 2015 13:46:03 +0200 Subject: doc: add missing symbol --- src/libstd/path.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 4a4db61c3b9..65d7b929c74 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -965,7 +965,7 @@ impl PathBuf { /// /// * if `path` has a root but no prefix (e.g. `\windows`), it /// replaces everything except for the prefix (if any) of `self`. - /// * if `path` has a prefix but no root, it replaces `self. + /// * if `path` has a prefix but no root, it replaces `self`. #[stable(feature = "rust1", since = "1.0.0")] pub fn push>(&mut self, path: P) { let path = path.as_ref(); -- cgit 1.4.1-3-g733a5 From b8de07d5e60f13d8aba07580c9173132ff0caa56 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 10 Aug 2015 23:52:18 +0200 Subject: doc: success is implied really --- src/libstd/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index a903452d540..31ff5b74fd6 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -750,8 +750,8 @@ impl AsInner for DirEntry { /// Removes a file from the underlying filesystem. /// -/// Note that, just because an unlink call was successful, it is not -/// guaranteed that a file is immediately deleted (e.g. depending on +/// Note that there is no +/// guarantee that the file is immediately deleted (e.g. depending on /// platform, other open file descriptors may prevent immediate removal). /// /// # Errors -- cgit 1.4.1-3-g733a5 From 9f597fe7eff6feb80afbbc1e8040ae503c6a6d43 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 11 Aug 2015 01:13:15 +0200 Subject: doc: remove an unneeded distinction --- src/libstd/fs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index a903452d540..3c6748a804a 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -748,7 +748,7 @@ impl AsInner for DirEntry { fn as_inner(&self) -> &fs_imp::DirEntry { &self.0 } } -/// Removes a file from the underlying filesystem. +/// Removes a file from the filesystem. /// /// Note that, just because an unlink call was successful, it is not /// guaranteed that a file is immediately deleted (e.g. depending on -- cgit 1.4.1-3-g733a5