diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-02-14 15:42:35 -0800 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-02-14 21:23:37 -0800 |
| commit | 8cc8eb7b8e57a09652f18c466c37946e24ae8021 (patch) | |
| tree | 8104e0baed41d769f4de52ade25ac6ef302b8583 /src/libstd/path | |
| parent | 994747022a45b5c2b03f38dddbe8b43bf09679f3 (diff) | |
| download | rust-8cc8eb7b8e57a09652f18c466c37946e24ae8021.tar.gz rust-8cc8eb7b8e57a09652f18c466c37946e24ae8021.zip | |
Add c_str::CString.as_bytes_no_nul()
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index ed0ce201750..13496033fd0 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -578,8 +578,7 @@ impl BytesContainer for ~[u8] { impl BytesContainer for CString { #[inline] fn container_as_bytes<'a>(&'a self) -> &'a [u8] { - let s = self.as_bytes(); - s.slice_to(s.len()-1) + self.as_bytes_no_nul() } } |
