Syntax cleaning bit.

This commit is contained in:
Andrés N. Robalino 2019-07-30 11:29:11 -05:00
parent 8ac36e0e83
commit 193b8dbe20

View file

@ -24,18 +24,16 @@ impl Str {
} }
fn fields(&self) -> u8 { fn fields(&self) -> u8 {
[ [self.downcase, self.upcase, self.int].iter().fold(
self.downcase, 0,
self.upcase, |acc, &field| {
self.int
].iter()
.fold(0, |acc, &field| {
if field { if field {
acc + 1 acc + 1
} else { } else {
acc acc
} }
}) },
)
} }
fn is_valid(&self) -> bool { fn is_valid(&self) -> bool {
@ -265,10 +263,7 @@ mod tests {
fn sample_record(key: &str, value: &str) -> Spanned<Value> { fn sample_record(key: &str, value: &str) -> Spanned<Value> {
let mut record = SpannedDictBuilder::new(Span::unknown()); let mut record = SpannedDictBuilder::new(Span::unknown());
record.insert( record.insert(key.clone(), Value::string(value));
key.clone(),
Value::string(value),
);
record.into_spanned_value() record.into_spanned_value()
} }