@@ -23,17 +23,16 @@ use parse::token;
23
23
use ptr:: P ;
24
24
25
25
use std:: collections:: HashMap ;
26
- use std:: string;
27
26
28
27
#[ deriving( PartialEq ) ]
29
28
enum ArgumentType {
30
- Known ( string :: String ) ,
29
+ Known ( String ) ,
31
30
Unsigned
32
31
}
33
32
34
33
enum Position {
35
34
Exact ( uint ) ,
36
- Named ( string :: String ) ,
35
+ Named ( String ) ,
37
36
}
38
37
39
38
struct Context < ' a , ' b : ' a > {
@@ -48,12 +47,12 @@ struct Context<'a, 'b:'a> {
48
47
/// Note that we keep a side-array of the ordering of the named arguments
49
48
/// found to be sure that we can translate them in the same order that they
50
49
/// 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 > ,
54
53
55
54
/// The latest consecutive literal strings, or empty if there weren't any.
56
- literal : string :: String ,
55
+ literal : String ,
57
56
58
57
/// Collection of the compiled `rt::Argument` structures
59
58
pieces : Vec < P < ast:: Expr > > ,
@@ -62,7 +61,7 @@ struct Context<'a, 'b:'a> {
62
61
/// Stays `true` if all formatting parameters are default (as in "{}{}").
63
62
all_pieces_simple : bool ,
64
63
65
- name_positions : HashMap < string :: String , uint > ,
64
+ name_positions : HashMap < String , uint > ,
66
65
67
66
/// Updated as arguments are consumed or methods are entered
68
67
nest_level : uint ,
@@ -84,10 +83,10 @@ pub enum Invocation {
84
83
/// named arguments))
85
84
fn parse_args ( ecx : & mut ExtCtxt , sp : Span , allow_method : bool ,
86
85
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 > > ) > ) {
89
88
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 ( ) ;
91
90
let mut order = Vec :: new ( ) ;
92
91
93
92
let mut p = ecx. new_parser_from_tts ( tts) ;
@@ -224,7 +223,7 @@ impl<'a, 'b> Context<'a, 'b> {
224
223
}
225
224
}
226
225
227
- fn describe_num_args ( & self ) -> string :: String {
226
+ fn describe_num_args ( & self ) -> String {
228
227
match self . args . len ( ) {
229
228
0 => "no arguments given" . to_string ( ) ,
230
229
1 => "there is 1 argument" . to_string ( ) ,
@@ -715,7 +714,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, sp: Span,
715
714
name_ordering : name_ordering,
716
715
nest_level : 0 ,
717
716
next_arg : 0 ,
718
- literal : string :: String :: new ( ) ,
717
+ literal : String :: new ( ) ,
719
718
pieces : Vec :: new ( ) ,
720
719
str_pieces : Vec :: new ( ) ,
721
720
all_pieces_simple : true ,
0 commit comments