From eb5417bf12ea7f709f6603308d86b61a1fc845c5 Mon Sep 17 00:00:00 2001 From: Wang Xuerui Date: Sat, 21 May 2016 12:58:17 +0800 Subject: syntax_ext: format: rename variants of ArgumentType for clarity --- src/libsyntax_ext/format.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/libsyntax_ext') 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) -> P { 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]) } -- cgit 1.4.1-3-g733a5