diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-12-20 23:37:25 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-12-27 23:55:14 +0200 |
| commit | 3961adcaf0fbf5739c5e83f0e322692e5c69e58d (patch) | |
| tree | 1dc73a3557888af11c404889e9a848dadd63222b /src/libsyntax/ext | |
| parent | 68a7f1b5e37f3b8a83def4e9cb4d02aef33b8dbf (diff) | |
| download | rust-3961adcaf0fbf5739c5e83f0e322692e5c69e58d.tar.gz rust-3961adcaf0fbf5739c5e83f0e322692e5c69e58d.zip | |
syntax: use std::string::String unqualified in format.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/format.rs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index dc5a899aa6b..771438342ee 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<string::String, P<ast::Expr>>, - name_types: HashMap<string::String, ArgumentType>, - name_ordering: Vec<string::String>, + names: HashMap<String, P<ast::Expr>>, + name_types: HashMap<String, ArgumentType>, + name_ordering: Vec<String>, /// 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<P<ast::Expr>>, @@ -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<string::String, uint>, + name_positions: HashMap<String, uint>, /// 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<ast::Expr>, Vec<P<ast::Expr>>, Vec<string::String>, - HashMap<string::String, P<ast::Expr>>)>) { + -> (Invocation, Option<(P<ast::Expr>, Vec<P<ast::Expr>>, Vec<String>, + HashMap<String, P<ast::Expr>>)>) { let mut args = Vec::new(); - let mut names = HashMap::<string::String, P<ast::Expr>>::new(); + let mut names = HashMap::<String, P<ast::Expr>>::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, |
