mirror of
https://git.proxmox.com/git/proxmox-offline-mirror
synced 2025-07-27 21:33:05 +00:00
various clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
089314eaa7
commit
15254c1755
@ -30,7 +30,7 @@ proxmox-apt = "0.11"
|
|||||||
proxmox-apt-api-types = "1.0"
|
proxmox-apt-api-types = "1.0"
|
||||||
proxmox-async = "0.4"
|
proxmox-async = "0.4"
|
||||||
proxmox-http = { version = "0.9", features = [ "client-sync", "client-trait" ]}
|
proxmox-http = { version = "0.9", features = [ "client-sync", "client-trait" ]}
|
||||||
proxmox-router = { version = "2", features = [ "cli" ], default_features = false }
|
proxmox-router = { version = "2", features = [ "cli" ], default-features = false }
|
||||||
proxmox-schema = { version = "3", features = [ "api-macro" ] }
|
proxmox-schema = { version = "3", features = [ "api-macro" ] }
|
||||||
proxmox-section-config = "2"
|
proxmox-section-config = "2"
|
||||||
proxmox-serde = "0.1"
|
proxmox-serde = "0.1"
|
||||||
|
@ -432,12 +432,11 @@ fn action_add_mirror(config: &SectionConfigData) -> Result<Vec<MirrorConfig>, Er
|
|||||||
(Some(ProductType::Pmg), "PMG"),
|
(Some(ProductType::Pmg), "PMG"),
|
||||||
(None, "None"),
|
(None, "None"),
|
||||||
];
|
];
|
||||||
use_subscription = read_selection_from_tty(
|
use_subscription.clone_from(read_selection_from_tty(
|
||||||
"Does this repository require a valid Proxmox subscription key",
|
"Does this repository require a valid Proxmox subscription key",
|
||||||
subscription_products,
|
subscription_products,
|
||||||
None,
|
None,
|
||||||
)?
|
)?);
|
||||||
.clone();
|
|
||||||
|
|
||||||
(repo, key_path, architectures, None, SkipConfig::default())
|
(repo, key_path, architectures, None, SkipConfig::default())
|
||||||
};
|
};
|
||||||
@ -707,7 +706,7 @@ fn action_add_key(config: &SectionConfigData) -> Result<SubscriptionKey, Error>
|
|||||||
};
|
};
|
||||||
|
|
||||||
let key = read_string_from_tty("Please enter subscription key", None)?;
|
let key = read_string_from_tty("Please enter subscription key", None)?;
|
||||||
if config.sections.get(&key).is_some() {
|
if config.sections.contains_key(&key) {
|
||||||
bail!("Key entry for '{key}' already exists - please use 'key refresh' or 'key update'!");
|
bail!("Key entry for '{key}' already exists - please use 'key refresh' or 'key update'!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ async fn add_mirror(
|
|||||||
|
|
||||||
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
||||||
|
|
||||||
if section_config.sections.get(&data.id).is_some() {
|
if section_config.sections.contains_key(&data.id) {
|
||||||
param_bail!("name", "mirror config entry '{}' already exists.", data.id);
|
param_bail!("name", "mirror config entry '{}' already exists.", data.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ async fn add_medium(
|
|||||||
|
|
||||||
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
||||||
|
|
||||||
if section_config.sections.get(&data.id).is_some() {
|
if section_config.sections.contains_key(&data.id) {
|
||||||
param_bail!("name", "config section '{}' already exists.", data.id);
|
param_bail!("name", "config section '{}' already exists.", data.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ async fn add_mirror_key(config: Option<String>, key: String, _param: Value) -> R
|
|||||||
|
|
||||||
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
||||||
|
|
||||||
if section_config.sections.get(&key).is_some() {
|
if section_config.sections.contains_key(&key) {
|
||||||
param_bail!(
|
param_bail!(
|
||||||
"key",
|
"key",
|
||||||
"key entry for '{}' already exists - did you mean to update or refresh?",
|
"key entry for '{}' already exists - did you mean to update or refresh?",
|
||||||
@ -289,7 +289,7 @@ async fn add_key(
|
|||||||
|
|
||||||
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
let (mut section_config, _digest) = proxmox_offline_mirror::config::config(&config)?;
|
||||||
|
|
||||||
if section_config.sections.get(&data.key).is_some() {
|
if section_config.sections.contains_key(&data.key) {
|
||||||
param_bail!(
|
param_bail!(
|
||||||
"key",
|
"key",
|
||||||
"key entry for '{}' already exists - did you mean to update or refresh?",
|
"key entry for '{}' already exists - did you mean to update or refresh?",
|
||||||
|
Loading…
Reference in New Issue
Block a user