Collapse unnecessary block (#128)

This commit is contained in:
Casey Rodarmor 2016-11-18 07:07:20 -08:00 committed by GitHub
parent 1ac5b4ea42
commit 11c0d349db

View File

@ -311,16 +311,14 @@ impl<'a> Recipe<'a> {
message: "missing parameter without default".to_string() message: "missing parameter without default".to_string()
}), }),
} }
} else if parameter.variadic {
let value = Cow::Owned(rest.to_vec().join(" "));
rest = &[];
value
} else { } else {
if parameter.variadic { let value = Cow::Borrowed(rest[0]);
let value = Cow::Owned(rest.to_vec().join(" ")); rest = &rest[1..];
rest = &[]; value
value
} else {
let value = Cow::Borrowed(rest[0]);
rest = &rest[1..];
value
}
}; };
argument_map.insert(parameter.name, value); argument_map.insert(parameter.name, value);
} }