Skip to content

Commit

Permalink
After merge fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Sep 30, 2024
1 parent 6a6232b commit 90797dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rust/agama-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::{

use crate::show_progress;
use agama_lib::{
base_http_client::BaseHTTPClient, connection, install_settings::InstallSettings,
base_http_client::BaseHTTPClient, install_settings::InstallSettings,
Store as SettingsStore,
};
use anyhow::anyhow;
Expand Down Expand Up @@ -63,7 +63,7 @@ pub enum ConfigCommands {
}

pub async fn run(http_client: BaseHTTPClient, subcommand: ConfigCommands) -> anyhow::Result<()> {
let store = SettingsStore::new(connection().await?, http_client).await?;
let store = SettingsStore::new(http_client).await?;

match subcommand {
ConfigCommands::Show => {
Expand Down
3 changes: 1 addition & 2 deletions rust/agama-cli/src/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use agama_lib::{
base_http_client::BaseHTTPClient,
connection,
install_settings::InstallSettings,
profile::{AutoyastProfile, ProfileEvaluator, ProfileValidator, ValidationResult},
Store as SettingsStore,
Expand Down Expand Up @@ -167,7 +166,7 @@ async fn import(url_string: String, dir: Option<PathBuf>) -> anyhow::Result<()>
}

async fn store_settings<P: AsRef<Path>>(path: P) -> anyhow::Result<()> {
let store = SettingsStore::new(connection().await?, BaseHTTPClient::new()?).await?;
let store = SettingsStore::new(BaseHTTPClient::new()?).await?;
let settings = InstallSettings::from_file(&path)?;
store.store(&settings).await?;
Ok(())
Expand Down
11 changes: 5 additions & 6 deletions rust/agama-lib/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,17 @@ pub struct Store {
localization: LocalizationStore,
}

impl<'a> Store<'a> {
impl Store {
pub async fn new(
connection: Connection,
http_client: BaseHTTPClient,
) -> Result<Store<'a>, ServiceError> {
) -> Result<Store, ServiceError> {
Ok(Self {
localization: LocalizationStore::new(http_client.clone())?,
users: UsersStore::new(http_client.clone())?,
network: NetworkStore::new(http_client.clone()).await?,
product: ProductStore::new(connection.clone()).await?,
software: SoftwareStore::new(connection.clone()).await?,
storage: StorageStore::new(connection).await?,
product: ProductStore::new()?,
software: SoftwareStore::new()?,
storage: StorageStore::new()?,
})
}

Expand Down

0 comments on commit 90797dc

Please sign in to comment.