From f8b1620ca7379b0662d91620f637b7e2212d0baf Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sun, 28 Jul 2024 10:01:35 +0000 Subject: [PATCH] pacify the merciless cargo fmt --- src/storage.rs | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/storage.rs b/src/storage.rs index d37ada2c..689b4eab 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -41,10 +41,7 @@ pub trait Zalsa { fn lookup_ingredient(&self, index: IngredientIndex) -> &dyn Ingredient; /// Gets an `&mut`-ref to an ingredient by index. - fn lookup_ingredient_mut( - &mut self, - index: IngredientIndex, - ) -> &mut dyn Ingredient; + fn lookup_ingredient_mut(&mut self, index: IngredientIndex) -> &mut dyn Ingredient; fn runtimex(&self) -> &Runtime; @@ -88,11 +85,11 @@ impl Zalsa for ZalsaImpl { let ingredients = jar.create_ingredients(index); for ingredient in ingredients { let expected_index = ingredient.ingredient_index(); - + if ingredient.requires_reset_for_new_revision() { self.ingredients_requiring_reset.push(expected_index); } - + let actual_index = self .ingredients_vec .push(ingredient); @@ -104,7 +101,7 @@ impl Zalsa for ZalsaImpl { expected_index, actual_index, ); - + } index }) @@ -115,33 +112,30 @@ impl Zalsa for ZalsaImpl { &**self.ingredients_vec.get(index.as_usize()).unwrap() } - fn lookup_ingredient_mut( - &mut self, - index: IngredientIndex, - ) -> &mut dyn Ingredient { + fn lookup_ingredient_mut(&mut self, index: IngredientIndex) -> &mut dyn Ingredient { &mut **self.ingredients_vec.get_mut(index.as_usize()).unwrap() } fn current_revision(&self) -> Revision { self.runtime.current_revision() } - + fn load_cancellation_flag(&self) -> bool { self.runtime.load_cancellation_flag() } - + fn report_tracked_write(&mut self, durability: Durability) { self.runtime.report_tracked_write(durability) } - + fn runtimex(&self) -> &Runtime { &self.runtime } - + fn last_changed_revision(&self, durability: Durability) -> Revision { self.runtime.last_changed_revision(durability) } - + fn set_cancellation_flag(&self) { self.runtime.set_cancellation_flag() } @@ -190,7 +184,7 @@ impl IngredientIndex { /// It is shared between the main database and any active snapshots. pub(crate) struct ZalsaImpl { user_data: U, - + views_of: Views, nonce: Nonce,