diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index dc5a899aa6b9..771438342ee3 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -23,17 +23,16 @@ use parse::token; use ptr::P; use std::collections::HashMap; -use std::string; #[deriving(PartialEq)] enum ArgumentType { - Known(string::String), + Known(String), Unsigned } enum Position { Exact(uint), - Named(string::String), + Named(String), } struct Context<'a, 'b:'a> { @@ -48,12 +47,12 @@ struct Context<'a, 'b:'a> { /// Note that we keep a side-array of the ordering of the named arguments /// found to be sure that we can translate them in the same order that they /// were declared in. - names: HashMap>, - name_types: HashMap, - name_ordering: Vec, + names: HashMap>, + name_types: HashMap, + name_ordering: Vec, /// The latest consecutive literal strings, or empty if there weren't any. - literal: string::String, + literal: String, /// Collection of the compiled `rt::Argument` structures pieces: Vec>, @@ -62,7 +61,7 @@ struct Context<'a, 'b:'a> { /// Stays `true` if all formatting parameters are default (as in "{}{}"). all_pieces_simple: bool, - name_positions: HashMap, + name_positions: HashMap, /// Updated as arguments are consumed or methods are entered nest_level: uint, @@ -84,10 +83,10 @@ pub enum Invocation { /// named arguments)) fn parse_args(ecx: &mut ExtCtxt, sp: Span, allow_method: bool, tts: &[ast::TokenTree]) - -> (Invocation, Option<(P, Vec>, Vec, - HashMap>)>) { + -> (Invocation, Option<(P, Vec>, Vec, + HashMap>)>) { let mut args = Vec::new(); - let mut names = HashMap::>::new(); + let mut names = HashMap::>::new(); let mut order = Vec::new(); let mut p = ecx.new_parser_from_tts(tts); @@ -224,7 +223,7 @@ impl<'a, 'b> Context<'a, 'b> { } } - fn describe_num_args(&self) -> string::String { + fn describe_num_args(&self) -> String { match self.args.len() { 0 => "no arguments given".to_string(), 1 => "there is 1 argument".to_string(), @@ -715,7 +714,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span, name_ordering: name_ordering, nest_level: 0, next_arg: 0, - literal: string::String::new(), + literal: String::new(), pieces: Vec::new(), str_pieces: Vec::new(), all_pieces_simple: true,