From beaf143679cbe623dc503372ea5f625af797d546 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Mon, 14 Oct 2024 23:28:02 +0200 Subject: [PATCH] style: use default index name constant --- src/cli/commands/auth/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/commands/auth/mod.rs b/src/cli/commands/auth/mod.rs index 2b59f5c..bcde22d 100644 --- a/src/cli/commands/auth/mod.rs +++ b/src/cli/commands/auth/mod.rs @@ -1,6 +1,6 @@ use crate::cli::config::read_config; use clap::{Args, Subcommand}; -use pesde::{errors::ManifestReadError, Project}; +use pesde::{errors::ManifestReadError, Project, DEFAULT_INDEX_NAME}; mod login; mod logout; @@ -51,11 +51,11 @@ impl AuthSubcommand { let index_url = match index_url { Some(url) => url, None => { - let index_name = self.index.as_deref().unwrap_or("default"); + let index_name = self.index.as_deref().unwrap_or(DEFAULT_INDEX_NAME); match manifest.unwrap().indices.get(index_name) { Some(index) => index.clone(), - None => anyhow::bail!("index {index_name} not found"), + None => anyhow::bail!("index {index_name} not found in manifest"), } } };