From 193b8dbe20d5d407110e3e03651f2d82159510d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Tue, 30 Jul 2019 11:29:11 -0500 Subject: [PATCH] Syntax cleaning bit. --- src/plugins/str.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/plugins/str.rs b/src/plugins/str.rs index 8a2cf37af9..704901a258 100644 --- a/src/plugins/str.rs +++ b/src/plugins/str.rs @@ -24,18 +24,16 @@ impl Str { } fn fields(&self) -> u8 { - [ - self.downcase, - self.upcase, - self.int - ].iter() - .fold(0, |acc, &field| { - if field { + [self.downcase, self.upcase, self.int].iter().fold( + 0, + |acc, &field| { + if field { acc + 1 } else { acc } - }) + }, + ) } fn is_valid(&self) -> bool { @@ -57,7 +55,7 @@ impl Str { fn for_input(&mut self, field: String) { self.field = Some(field); } - + fn for_to_int(&mut self) { self.int = true; @@ -265,10 +263,7 @@ mod tests { fn sample_record(key: &str, value: &str) -> Spanned { let mut record = SpannedDictBuilder::new(Span::unknown()); - record.insert( - key.clone(), - Value::string(value), - ); + record.insert(key.clone(), Value::string(value)); record.into_spanned_value() }