Skip to content

Commit b8a7116

Browse files
committed
syntax: use std::string::String unqualified in format.
1 parent 52f0dfc commit b8a7116

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/libsyntax/ext/format.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ use parse::token;
2323
use ptr::P;
2424

2525
use std::collections::HashMap;
26-
use std::string;
2726

2827
#[deriving(PartialEq)]
2928
enum ArgumentType {
30-
Known(string::String),
29+
Known(String),
3130
Unsigned
3231
}
3332

3433
enum Position {
3534
Exact(uint),
36-
Named(string::String),
35+
Named(String),
3736
}
3837

3938
struct Context<'a, 'b:'a> {
@@ -48,12 +47,12 @@ struct Context<'a, 'b:'a> {
4847
/// Note that we keep a side-array of the ordering of the named arguments
4948
/// found to be sure that we can translate them in the same order that they
5049
/// were declared in.
51-
names: HashMap<string::String, P<ast::Expr>>,
52-
name_types: HashMap<string::String, ArgumentType>,
53-
name_ordering: Vec<string::String>,
50+
names: HashMap<String, P<ast::Expr>>,
51+
name_types: HashMap<String, ArgumentType>,
52+
name_ordering: Vec<String>,
5453

5554
/// The latest consecutive literal strings, or empty if there weren't any.
56-
literal: string::String,
55+
literal: String,
5756

5857
/// Collection of the compiled `rt::Argument` structures
5958
pieces: Vec<P<ast::Expr>>,
@@ -62,7 +61,7 @@ struct Context<'a, 'b:'a> {
6261
/// Stays `true` if all formatting parameters are default (as in "{}{}").
6362
all_pieces_simple: bool,
6463

65-
name_positions: HashMap<string::String, uint>,
64+
name_positions: HashMap<String, uint>,
6665

6766
/// Updated as arguments are consumed or methods are entered
6867
nest_level: uint,
@@ -84,10 +83,10 @@ pub enum Invocation {
8483
/// named arguments))
8584
fn parse_args(ecx: &mut ExtCtxt, sp: Span, allow_method: bool,
8685
tts: &[ast::TokenTree])
87-
-> (Invocation, Option<(P<ast::Expr>, Vec<P<ast::Expr>>, Vec<string::String>,
88-
HashMap<string::String, P<ast::Expr>>)>) {
86+
-> (Invocation, Option<(P<ast::Expr>, Vec<P<ast::Expr>>, Vec<String>,
87+
HashMap<String, P<ast::Expr>>)>) {
8988
let mut args = Vec::new();
90-
let mut names = HashMap::<string::String, P<ast::Expr>>::new();
89+
let mut names = HashMap::<String, P<ast::Expr>>::new();
9190
let mut order = Vec::new();
9291

9392
let mut p = ecx.new_parser_from_tts(tts);
@@ -224,7 +223,7 @@ impl<'a, 'b> Context<'a, 'b> {
224223
}
225224
}
226225

227-
fn describe_num_args(&self) -> string::String {
226+
fn describe_num_args(&self) -> String {
228227
match self.args.len() {
229228
0 => "no arguments given".to_string(),
230229
1 => "there is 1 argument".to_string(),
@@ -715,7 +714,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
715714
name_ordering: name_ordering,
716715
nest_level: 0,
717716
next_arg: 0,
718-
literal: string::String::new(),
717+
literal: String::new(),
719718
pieces: Vec::new(),
720719
str_pieces: Vec::new(),
721720
all_pieces_simple: true,

0 commit comments

Comments
 (0)