clippy refactoring

This commit is contained in:
Lukáš Hozda
2017-10-02 23:44:45 +02:00
parent 92465e899e
commit a1e92d006c
5 changed files with 184 additions and 204 deletions

View File

@@ -52,7 +52,7 @@ impl<'a, A, T, U, V, W, X, Y, Z> FnRegister<A, Z, (&'a mut T, U, V, W, X, Y)> fo
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn6(wrapped));
}
}
@@ -102,7 +102,7 @@ impl<'a, A, T, U, V, W, X, Y, Z> FnRegister<A, Z, (&'a T, U, V, W, X, Y)> for En
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn6(wrapped));
}
}
@@ -143,7 +143,7 @@ impl<'a, A, T, U, V, W, X, Y> FnRegister<A, Y, (&'a mut T, U, V, W, X)> for Engi
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn5(wrapped));
}
}
@@ -188,7 +188,7 @@ impl<'a, A, T, U, V, W, X, Y> FnRegister<A, Y, (&'a T, U, V, W, X)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn5(wrapped));
}
}
@@ -221,7 +221,7 @@ impl<'a, A, T, U, V, W, X> FnRegister<A, X, (&'a mut T, U, V, W)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn4(wrapped));
}
}
@@ -254,7 +254,7 @@ impl<'a, A, T, U, V, W, X> FnRegister<A, X, (&'a T, U, V, W)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn4(wrapped));
}
}
@@ -282,7 +282,7 @@ impl<'a, A, T, U, V, W> FnRegister<A, W, (&'a mut T, U, V)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn3(wrapped));
}
}
@@ -310,7 +310,7 @@ impl<'a, A, T, U, V, W> FnRegister<A, W, (&'a T, U, V)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn3(wrapped));
}
}
@@ -333,7 +333,7 @@ impl<'a, A, T, U, V> FnRegister<A, V, (&'a mut T, U)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn2(wrapped));
}
}
@@ -356,7 +356,7 @@ impl<'a, A, T, U, V> FnRegister<A, V, (&'a T, U)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn2(wrapped));
}
}
@@ -377,7 +377,7 @@ impl<'a, A, T, U> FnRegister<A, U, (&'a mut T)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn1(wrapped));
}
}
@@ -398,7 +398,7 @@ impl<'a, A, T, U> FnRegister<A, U, (&'a T)> for Engine
}
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn1(wrapped));
}
}
@@ -412,7 +412,7 @@ impl<A, T> FnRegister<A, T, ()> for Engine
Ok(Box::new(fun()) as Box<Any>)
});
let ent = self.fns.entry(name.to_string()).or_insert(Vec::new());
let ent = self.fns.entry(name.to_string()).or_insert_with(Vec::new);
(*ent).push(FnType::ExternalFn0(wrapped));
}
}