about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorWang Xuerui <idontknw.wang@gmail.com>2016-05-21 12:58:17 +0800
committerWang Xuerui <idontknw.wang@gmail.com>2016-07-14 03:10:45 +0800
commiteb5417bf12ea7f709f6603308d86b61a1fc845c5 (patch)
treea89f7019118ecef960012cd49cc74c01f003dee0 /src/libsyntax_ext
parent1ace7f0d49f9e482efe680d691a9d1a8f7e53f60 (diff)
downloadrust-eb5417bf12ea7f709f6603308d86b61a1fc845c5.tar.gz
rust-eb5417bf12ea7f709f6603308d86b61a1fc845c5.zip
syntax_ext: format: rename variants of ArgumentType for clarity
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/format.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index 2635213f58e..9e6a83a1863 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -27,8 +27,8 @@ use std::collections::HashMap;
 
 #[derive(PartialEq)]
 enum ArgumentType {
-    Known(String),
-    Unsigned
+    Placeholder(String),
+    Count,
 }
 
 enum Position {
@@ -182,7 +182,7 @@ impl<'a, 'b> Context<'a, 'b> {
                     parse::ArgumentNamed(s) => Named(s.to_string()),
                 };
 
-                let ty = Known(arg.format.ty.to_string());
+                let ty = Placeholder(arg.format.ty.to_string());
                 self.verify_arg_type(pos, ty);
             }
         }
@@ -192,10 +192,10 @@ impl<'a, 'b> Context<'a, 'b> {
         match c {
             parse::CountImplied | parse::CountIs(..) => {}
             parse::CountIsParam(i) => {
-                self.verify_arg_type(Exact(i), Unsigned);
+                self.verify_arg_type(Exact(i), Count);
             }
             parse::CountIsName(s) => {
-                self.verify_arg_type(Named(s.to_string()), Unsigned);
+                self.verify_arg_type(Named(s.to_string()), Count);
             }
         }
     }
@@ -545,7 +545,7 @@ impl<'a, 'b> Context<'a, 'b> {
                   ty: &ArgumentType, arg: P<ast::Expr>)
                   -> P<ast::Expr> {
         let trait_ = match *ty {
-            Known(ref tyname) => {
+            Placeholder(ref tyname) => {
                 match &tyname[..] {
                     ""  => "Display",
                     "?" => "Debug",
@@ -564,7 +564,7 @@ impl<'a, 'b> Context<'a, 'b> {
                     }
                 }
             }
-            Unsigned => {
+            Count => {
                 let path = ecx.std_path(&["fmt", "ArgumentV1", "from_usize"]);
                 return ecx.expr_call_global(macsp, path, vec![arg])
             }