Skip to content

Commit

Permalink
rename fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Janaka-Steph committed Nov 2, 2023
1 parent 535d78e commit a9e2e1e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/controller_binaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ pub async fn add_registry(
.with_context(|| "Failed to insert into store")?;
store.save().expect("failed to save store");
// Fetch services from the new registry
utils::fetch_all_services_manifest(&registries, &state)
utils::fetch_all_services_manifests(&registries, &state)
.await
.expect("failed to fetch services")
}
Expand Down Expand Up @@ -534,7 +534,7 @@ pub async fn delete_registry(
drop(services_guard);
if let Some(registries) = store.get("registries").cloned() {
match serde_json::from_value::<Vec<Registry>>(registries) {
Ok(registries) => utils::fetch_all_services_manifest(&registries, &state)
Ok(registries) => utils::fetch_all_services_manifests(&registries, &state)
.await
.expect("failed to fetch services"),
Err(e) => println!("Error unwrapping registries: {:?}", e),
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ fn main() {
Ok(_) => {
if let Some(registries) = store.get("registries").cloned() {
match serde_json::from_value::<Vec<Registry>>(registries) {
Ok(registries) => utils::fetch_all_services_manifest(&registries, &app.state::<Arc<SharedState>>().clone()).await.unwrap_or_default(),
Ok(registries) => utils::fetch_all_services_manifests(&registries, &app.state::<Arc<SharedState>>().clone()).await.unwrap_or_default(),
Err(e) => println!("Error unwrapping registries: {:?}", e)
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use reqwest::get;
use std::collections::HashMap;
use std::sync::Arc;

pub async fn fetch_all_services_manifest(
pub async fn fetch_all_services_manifests(
registries: &Vec<Registry>,
state: &Arc<SharedState>,
) -> Result<()> {
Expand All @@ -25,7 +25,7 @@ pub async fn fetch_all_services_manifest(
Ok(())
}

pub async fn fetch_services_manifests(url: &str, state: &Arc<SharedState>) -> Result<()> {
async fn fetch_services_manifests(url: &str, state: &Arc<SharedState>) -> Result<()> {
let response = get(url)
.await
.with_context(|| format!("Couldn't fetch the manifest from {url:?}"))?;
Expand Down

0 comments on commit a9e2e1e

Please sign in to comment.