diff options
| author | bors <bors@rust-lang.org> | 2015-08-11 11:20:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-08-11 11:20:11 +0000 |
| commit | c756526eb2aed91e96d2b5d9461898cb33565707 (patch) | |
| tree | 3f609da8d07cf04617e277e56890b794e2345062 /src/libstd | |
| parent | 23f43896ce92830173e503eab8b2f7fba8137e37 (diff) | |
| parent | aebd6d5106243a926c39d02c84917b473b65dcc0 (diff) | |
| download | rust-c756526eb2aed91e96d2b5d9461898cb33565707.tar.gz rust-c756526eb2aed91e96d2b5d9461898cb33565707.zip | |
Auto merge of #27658 - Manishearth:rollup, r=Manishearth
- Successful merges: #27542, #27571, #27572, #27577, #27611, #27612, #27617, #27633, #27647, #27648, #27651 - Failed merges:
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs.rs | 6 | ||||
| -rw-r--r-- | src/libstd/path.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/os.rs | 10 |
3 files changed, 11 insertions, 7 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index a903452d540..6995ed07e99 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -748,10 +748,10 @@ impl AsInner<fs_imp::DirEntry> 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 +/// 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 diff --git a/src/libstd/path.rs b/src/libstd/path.rs index c3a887cbcb8..5b456b580e5 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<P: AsRef<Path>>(&mut self, path: P) { let path = path.as_ref(); 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), } |
