Skip to content

Commit eb5417b

Browse files
committed
syntax_ext: format: rename variants of ArgumentType for clarity
1 parent 1ace7f0 commit eb5417b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libsyntax_ext/format.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use std::collections::HashMap;
2727

2828
#[derive(PartialEq)]
2929
enum ArgumentType {
30-
Known(String),
31-
Unsigned
30+
Placeholder(String),
31+
Count,
3232
}
3333

3434
enum Position {
@@ -182,7 +182,7 @@ impl<'a, 'b> Context<'a, 'b> {
182182
parse::ArgumentNamed(s) => Named(s.to_string()),
183183
};
184184

185-
let ty = Known(arg.format.ty.to_string());
185+
let ty = Placeholder(arg.format.ty.to_string());
186186
self.verify_arg_type(pos, ty);
187187
}
188188
}
@@ -192,10 +192,10 @@ impl<'a, 'b> Context<'a, 'b> {
192192
match c {
193193
parse::CountImplied | parse::CountIs(..) => {}
194194
parse::CountIsParam(i) => {
195-
self.verify_arg_type(Exact(i), Unsigned);
195+
self.verify_arg_type(Exact(i), Count);
196196
}
197197
parse::CountIsName(s) => {
198-
self.verify_arg_type(Named(s.to_string()), Unsigned);
198+
self.verify_arg_type(Named(s.to_string()), Count);
199199
}
200200
}
201201
}
@@ -545,7 +545,7 @@ impl<'a, 'b> Context<'a, 'b> {
545545
ty: &ArgumentType, arg: P<ast::Expr>)
546546
-> P<ast::Expr> {
547547
let trait_ = match *ty {
548-
Known(ref tyname) => {
548+
Placeholder(ref tyname) => {
549549
match &tyname[..] {
550550
"" => "Display",
551551
"?" => "Debug",
@@ -564,7 +564,7 @@ impl<'a, 'b> Context<'a, 'b> {
564564
}
565565
}
566566
}
567-
Unsigned => {
567+
Count => {
568568
let path = ecx.std_path(&["fmt", "ArgumentV1", "from_usize"]);
569569
return ecx.expr_call_global(macsp, path, vec![arg])
570570
}

0 commit comments

Comments
 (0)