Skip to content

Commit 9fa8914

Browse files
committed
Use f instead of formatter
The local variable `formatter` can be shortened to `f` with no loss of clarity since it is so common. Done in preparation for running `rustfmt` on `src`.
1 parent ce8977b commit 9fa8914

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/internal_macros.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ macro_rules! serde_string_impl {
142142
impl<'de> $crate::serde::de::Visitor<'de> for Visitor {
143143
type Value = $name;
144144

145-
fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
146-
formatter.write_str($expecting)
145+
fn expecting(&self, f: &mut Formatter) -> fmt::Result {
146+
f.write_str($expecting)
147147
}
148148

149149
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
@@ -190,8 +190,8 @@ macro_rules! serde_struct_human_string_impl {
190190
impl<'de> $crate::serde::de::Visitor<'de> for Visitor {
191191
type Value = $name;
192192

193-
fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
194-
formatter.write_str($expecting)
193+
fn expecting(&self, f: &mut Formatter) -> fmt::Result {
194+
f.write_str($expecting)
195195
}
196196

197197
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
@@ -215,8 +215,8 @@ macro_rules! serde_struct_human_string_impl {
215215
impl<'de> $crate::serde::de::Visitor<'de> for EnumVisitor {
216216
type Value = Enum;
217217

218-
fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
219-
formatter.write_str("a field name")
218+
fn expecting(&self, f: &mut Formatter) -> fmt::Result {
219+
f.write_str("a field name")
220220
}
221221

222222
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
@@ -246,8 +246,8 @@ macro_rules! serde_struct_human_string_impl {
246246
impl<'de> $crate::serde::de::Visitor<'de> for Visitor {
247247
type Value = $name;
248248

249-
fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
250-
formatter.write_str("a struct")
249+
fn expecting(&self, f: &mut Formatter) -> fmt::Result {
250+
f.write_str("a struct")
251251
}
252252

253253
fn visit_seq<V>(self, mut seq: V) -> Result<Self::Value, V::Error>
@@ -423,8 +423,8 @@ macro_rules! impl_bytes_newtype {
423423
impl<'de> $crate::serde::de::Visitor<'de> for HexVisitor {
424424
type Value = $t;
425425

426-
fn expecting(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
427-
formatter.write_str("an ASCII hex string")
426+
fn expecting(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
427+
f.write_str("an ASCII hex string")
428428
}
429429

430430
fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
@@ -453,8 +453,8 @@ macro_rules! impl_bytes_newtype {
453453
impl<'de> $crate::serde::de::Visitor<'de> for BytesVisitor {
454454
type Value = $t;
455455

456-
fn expecting(&self, formatter: &mut core::fmt::Formatter) -> core::fmt::Result {
457-
formatter.write_str("a bytestring")
456+
fn expecting(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
457+
f.write_str("a bytestring")
458458
}
459459

460460
fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
@@ -531,8 +531,8 @@ macro_rules! user_enum {
531531
impl<'de> $crate::serde::de::Visitor<'de> for Visitor {
532532
type Value = $name;
533533

534-
fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
535-
formatter.write_str("an enum value")
534+
fn expecting(&self, f: &mut Formatter) -> fmt::Result {
535+
f.write_str("an enum value")
536536
}
537537

538538
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>

0 commit comments

Comments
 (0)