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).
This commit is contained in:
Huon Wilson 2013-06-11 13:10:37 +10:00
parent ba4a4778cc
commit efc71a8bdb
44 changed files with 255 additions and 218 deletions

View file

@ -21,8 +21,6 @@ use ext::base::*;
use parse;
use parse::token;
use core::vec;
enum State {
Asm,
Outputs,

View file

@ -22,7 +22,6 @@ use parse::token;
use parse::token::{ident_to_str, intern, str_to_ident};
use core::hashmap::HashMap;
use core::vec;
// new-style macro! tt code:
//

View file

@ -18,7 +18,6 @@ use print;
use parse::token::{get_ident_interner};
use core::io;
use core::vec;
pub fn expand_syntax_ext(cx: @ExtCtxt,
sp: codemap::span,

View file

@ -19,8 +19,6 @@ use parse::token::*;
use parse::token;
use parse;
use core::vec;
/**
*
* Quasiquoting works via token trees.

View file

@ -18,8 +18,6 @@ use parse::lexer::{new_tt_reader, reader};
use parse::parser::Parser;
use parse::token::keywords;
use core::vec;
pub fn expand_trace_macros(cx: @ExtCtxt,
sp: span,
tt: &[ast::token_tree])

View file

@ -26,7 +26,6 @@ use parse::token::{FAT_ARROW, SEMI, nt_matchers, nt_tt};
use print;
use core::io;
use core::vec;
pub fn add_new_extension(cx: @ExtCtxt,
sp: span,