aboutsummaryrefslogtreecommitdiffstats
path: root/src/format.rs
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2019-07-18 09:22:50 -0700
committerDavid Tolnay <dtolnay@gmail.com>2019-07-18 09:22:50 -0700
commitf67035c1439fee47390be30f5399c1d4238ebe41 (patch)
tree61f25d65096cf447604e2ce439fa290fffadba9e /src/format.rs
parentd29563e7852c0e088622dcd65a57a36c56afa6a1 (diff)
downloadplatform_external_rust_crates_quote-f67035c1439fee47390be30f5399c1d4238ebe41.tar.gz
platform_external_rust_crates_quote-f67035c1439fee47390be30f5399c1d4238ebe41.tar.bz2
platform_external_rust_crates_quote-f67035c1439fee47390be30f5399c1d4238ebe41.zip
Clarify names of format_ident macro variables
Diffstat (limited to 'src/format.rs')
-rw-r--r--src/format.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/format.rs b/src/format.rs
index 6a1724e..99b0474 100644
--- a/src/format.rs
+++ b/src/format.rs
@@ -98,18 +98,18 @@
/// ```
#[macro_export]
macro_rules! format_ident {
- ($f:expr) => {
+ ($fmt:expr) => {
$crate::format_ident_impl!([
::std::option::Option::None,
- $f
+ $fmt
])
};
- ($f:expr, $($t:tt)*) => {
+ ($fmt:expr, $($rest:tt)*) => {
$crate::format_ident_impl!([
::std::option::Option::None,
- $f
- ] $($t)*,)
+ $fmt
+ ] $($rest)*,)
};
}
@@ -117,29 +117,29 @@ macro_rules! format_ident {
#[doc(hidden)]
macro_rules! format_ident_impl {
// Final state
- ([$span:expr, $($o:tt)*] $(,)*) => {
- $crate::__rt::mk_ident(&format!($($o)*), $span)
+ ([$span:expr, $($fmt:tt)*] $(,)*) => {
+ $crate::__rt::mk_ident(&format!($($fmt)*), $span)
};
// Span argument
- ([$_sp:expr, $($o:tt)*] span = $span:expr, $($t:tt)*) => {
+ ([$old:expr, $($fmt:tt)*] span = $span:expr, $($rest:tt)*) => {
$crate::format_ident_impl!([
::std::option::Option::Some::<$crate::__rt::Span>($span),
- $($o)*
- ] $($t)*)
+ $($fmt)*
+ ] $($rest)*)
};
// Named arguments
- ([$span:expr, $($o:tt)*] $i:ident = $e:expr, $($t:tt)*) => {
- match $crate::__rt::IdentFragmentAdapter(&$e) {
- arg => $crate::format_ident_impl!([$span.or(arg.span()), $($o)*, $i = arg] $($t)*),
+ ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr, $($rest:tt)*) => {
+ match $crate::__rt::IdentFragmentAdapter(&$arg) {
+ arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, $name = arg] $($rest)*),
}
};
// Positional arguments
- ([$span:expr, $($o:tt)*] $e:expr, $($t:tt)*) => {
- match $crate::__rt::IdentFragmentAdapter(&$e) {
- arg => $crate::format_ident_impl!([$span.or(arg.span()), $($o)*, arg] $($t)*),
+ ([$span:expr, $($fmt:tt)*] $arg:expr, $($rest:tt)*) => {
+ match $crate::__rt::IdentFragmentAdapter(&$arg) {
+ arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, arg] $($rest)*),
}
};
}