This commit is contained in:
Owen Sanchez 2017-02-10 21:08:50 -07:00
parent 2a8ce7c458
commit 8fb582ea1c

View file

@ -114,7 +114,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LargeEnumVariant {
}
}
fn update_if<T, F>(old: &mut Option<T>, new: T, f: F) where F: Fn(&T, &T) -> bool {
fn update_if<T, F>(old: &mut Option<T>, new: T, f: F)
where F: Fn(&T, &T) -> bool
{
if let Some(ref mut val) = *old {
if f(val, &new) {
*val = new;