Skip to content

Commit

Permalink
pass StorageSettings by reference
Browse files Browse the repository at this point in the history
for consistency with other FooStore structs
  • Loading branch information
mvidner committed Sep 17, 2024
1 parent cfead00 commit b7ba82a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rust/agama-lib/src/storage/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ impl StorageStore {
Ok(self.storage_client.get_config().await?)
}

pub async fn store(&self, settings: StorageSettings) -> Result<(), ServiceError> {
self.storage_client.set_config(&settings).await?;
pub async fn store(&self, settings: &StorageSettings) -> Result<(), ServiceError> {
self.storage_client.set_config(settings).await?;
Ok(())
}
}
Expand Down Expand Up @@ -90,7 +90,7 @@ mod test {
storage_autoyast: Some(boxed_raw_value),
};

let result = store.store(settings).await;
let result = store.store(&settings).await;

// main assertion
result?;
Expand Down
2 changes: 1 addition & 1 deletion rust/agama-lib/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Store {
self.users.store(user).await?;
}
if settings.storage.is_some() || settings.storage_autoyast.is_some() {
self.storage.store(settings.into()).await?
self.storage.store(&settings.into()).await?
}
Ok(())
}
Expand Down

0 comments on commit b7ba82a

Please sign in to comment.