diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-11 13:10:37 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-12 12:21:04 +1000 |
| commit | efc71a8bdb28fba88d0cc8916b33838bf43b3a8d (patch) | |
| tree | ad0086d4319facd8da21583e19a952a01250bbbd /src/librustc/back | |
| parent | ba4a4778cc17c64c33a891a0d2565a1fb04ddffc (diff) | |
std: unify the str -> [u8] functions as 3 methods: .as_bytes() and .as_bytes_with_null[_consume]().
The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
Diffstat (limited to 'src/librustc/back')
| -rw-r--r-- | src/librustc/back/link.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 1d31e4ddd87..84fb361adb9 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -50,8 +50,7 @@ pub enum output_type { } fn write_string<W:Writer>(writer: &mut W, string: &str) { - let buffer = str::as_bytes_slice(string); - writer.write(buffer); + writer.write(string.as_bytes()); } pub fn llvm_err(sess: Session, msg: ~str) -> ! { |
