pass slices around and not refs to vecs (#3404)

* pass slices around and not refs to vecs

* use slice.swap()

* use inputs() not body.inputs
This commit is contained in:
Antioch Peverell
2020-07-27 11:07:18 +01:00
committed by GitHub
parent 105f50b26b
commit 80841f16d2
29 changed files with 272 additions and 275 deletions
+2 -2
View File
@@ -488,14 +488,14 @@ impl<T: TableViewItem<H> + PartialEq, H: Eq + Hash + Copy + Clone + 'static> Tab
}
/// Returns a immutable reference to the items contained within the table.
pub fn borrow_items(&mut self) -> &Vec<T> {
pub fn borrow_items(&mut self) -> &[T] {
&self.items
}
/// Returns a mutable reference to the items contained within the table.
///
/// Can be used to modify the items in place.
pub fn borrow_items_mut(&mut self) -> &mut Vec<T> {
pub fn borrow_items_mut(&mut self) -> &mut [T] {
&mut self.items
}