pacify the merciless cargo fmt

This commit is contained in:
Niko Matsakis 2024-07-28 10:01:35 +00:00
parent a675810edf
commit f8b1620ca7

View file

@ -41,10 +41,7 @@ pub trait Zalsa {
fn lookup_ingredient(&self, index: IngredientIndex) -> &dyn Ingredient; fn lookup_ingredient(&self, index: IngredientIndex) -> &dyn Ingredient;
/// Gets an `&mut`-ref to an ingredient by index. /// Gets an `&mut`-ref to an ingredient by index.
fn lookup_ingredient_mut( fn lookup_ingredient_mut(&mut self, index: IngredientIndex) -> &mut dyn Ingredient;
&mut self,
index: IngredientIndex,
) -> &mut dyn Ingredient;
fn runtimex(&self) -> &Runtime; fn runtimex(&self) -> &Runtime;
@ -88,11 +85,11 @@ impl<U: UserData> Zalsa for ZalsaImpl<U> {
let ingredients = jar.create_ingredients(index); let ingredients = jar.create_ingredients(index);
for ingredient in ingredients { for ingredient in ingredients {
let expected_index = ingredient.ingredient_index(); let expected_index = ingredient.ingredient_index();
if ingredient.requires_reset_for_new_revision() { if ingredient.requires_reset_for_new_revision() {
self.ingredients_requiring_reset.push(expected_index); self.ingredients_requiring_reset.push(expected_index);
} }
let actual_index = self let actual_index = self
.ingredients_vec .ingredients_vec
.push(ingredient); .push(ingredient);
@ -104,7 +101,7 @@ impl<U: UserData> Zalsa for ZalsaImpl<U> {
expected_index, expected_index,
actual_index, actual_index,
); );
} }
index index
}) })
@ -115,33 +112,30 @@ impl<U: UserData> Zalsa for ZalsaImpl<U> {
&**self.ingredients_vec.get(index.as_usize()).unwrap() &**self.ingredients_vec.get(index.as_usize()).unwrap()
} }
fn lookup_ingredient_mut( fn lookup_ingredient_mut(&mut self, index: IngredientIndex) -> &mut dyn Ingredient {
&mut self,
index: IngredientIndex,
) -> &mut dyn Ingredient {
&mut **self.ingredients_vec.get_mut(index.as_usize()).unwrap() &mut **self.ingredients_vec.get_mut(index.as_usize()).unwrap()
} }
fn current_revision(&self) -> Revision { fn current_revision(&self) -> Revision {
self.runtime.current_revision() self.runtime.current_revision()
} }
fn load_cancellation_flag(&self) -> bool { fn load_cancellation_flag(&self) -> bool {
self.runtime.load_cancellation_flag() self.runtime.load_cancellation_flag()
} }
fn report_tracked_write(&mut self, durability: Durability) { fn report_tracked_write(&mut self, durability: Durability) {
self.runtime.report_tracked_write(durability) self.runtime.report_tracked_write(durability)
} }
fn runtimex(&self) -> &Runtime { fn runtimex(&self) -> &Runtime {
&self.runtime &self.runtime
} }
fn last_changed_revision(&self, durability: Durability) -> Revision { fn last_changed_revision(&self, durability: Durability) -> Revision {
self.runtime.last_changed_revision(durability) self.runtime.last_changed_revision(durability)
} }
fn set_cancellation_flag(&self) { fn set_cancellation_flag(&self) {
self.runtime.set_cancellation_flag() self.runtime.set_cancellation_flag()
} }
@ -190,7 +184,7 @@ impl IngredientIndex {
/// It is shared between the main database and any active snapshots. /// It is shared between the main database and any active snapshots.
pub(crate) struct ZalsaImpl<U: UserData> { pub(crate) struct ZalsaImpl<U: UserData> {
user_data: U, user_data: U,
views_of: Views, views_of: Views,
nonce: Nonce<StorageNonce>, nonce: Nonce<StorageNonce>,