From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7C1CE1FF173 for ; Mon, 24 Feb 2025 10:33:34 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 366E32DE3D; Mon, 24 Feb 2025 10:33:32 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Mon, 24 Feb 2025 10:33:25 +0100 Message-Id: <20250224093325.106165-3-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250224093325.106165-1-m.sandoval@proxmox.com> References: <20250224093325.106165-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.103 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH offline-mirror 3/3] cargo: run fmt X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" See the following links for the 2024 edition formatting changes: - https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-formatting-fixes.html - https://doc.rust-lang.org/edition-guide/rust-2024/rustfmt-version-sorting.html These format changes come exclusively from the edition and not from upgrading rustfmt to 1.85. Signed-off-by: Maximiliano Sandoval --- src/bin/docgen.rs | 2 +- src/bin/proxmox-offline-mirror-helper.rs | 14 ++-- src/bin/proxmox-offline-mirror.rs | 68 ++++++++++++++----- src/bin/proxmox_offline_mirror_cmds/config.rs | 8 +-- src/bin/proxmox_offline_mirror_cmds/medium.rs | 2 +- src/bin/proxmox_offline_mirror_cmds/mirror.rs | 8 +-- .../subscription.rs | 10 +-- src/config.rs | 8 +-- src/helpers/tty.rs | 2 +- src/helpers/verifier.rs | 6 +- src/lib.rs | 2 +- src/medium.rs | 16 +++-- src/mirror.rs | 8 +-- src/pool.rs | 16 +++-- src/subscription.rs | 4 +- src/types.rs | 2 +- 16 files changed, 109 insertions(+), 67 deletions(-) diff --git a/src/bin/docgen.rs b/src/bin/docgen.rs index c8812a6..6de17a1 100644 --- a/src/bin/docgen.rs +++ b/src/bin/docgen.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, Error}; +use anyhow::{Error, bail}; use proxmox_offline_mirror::config; use proxmox_section_config::dump_section_config; diff --git a/src/bin/proxmox-offline-mirror-helper.rs b/src/bin/proxmox-offline-mirror-helper.rs index cb6bb7b..7911d52 100644 --- a/src/bin/proxmox-offline-mirror-helper.rs +++ b/src/bin/proxmox-offline-mirror-helper.rs @@ -3,26 +3,26 @@ use std::path::PathBuf; use std::process::Command; use std::{collections::HashMap, path::Path}; -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use proxmox_offline_mirror::types::Snapshot; use proxmox_subscription::{ProductType, SubscriptionInfo}; use proxmox_sys::command::run_command; use proxmox_sys::fs::file_get_contents; -use proxmox_sys::fs::{replace_file, CreateOptions}; +use proxmox_sys::fs::{CreateOptions, replace_file}; use proxmox_time::epoch_to_rfc3339_utc; use serde_json::Value; use proxmox_router::cli::{ - format_and_print_result, get_output_format, run_cli_command, CliCommand, CliCommandMap, - CliEnvironment, OUTPUT_FORMAT, + CliCommand, CliCommandMap, CliEnvironment, OUTPUT_FORMAT, format_and_print_result, + get_output_format, run_cli_command, }; use proxmox_schema::{api, param_bail}; use proxmox_offline_mirror::helpers::tty::{ read_bool_from_tty, read_selection_from_tty, read_string_from_tty, }; -use proxmox_offline_mirror::medium::{self, generate_repo_snippet, MediumState}; +use proxmox_offline_mirror::medium::{self, MediumState, generate_repo_snippet}; fn set_subscription_key( product: &ProductType, @@ -211,7 +211,9 @@ async fn setup(_param: Value) -> Result<(), Error> { file.push(snippet_file_name); replace_file(file, data.as_bytes(), CreateOptions::default(), true)?; } else { - println!("Add above snippet to system's repository entries (/etc/apt/sources.list.d/) manually to configure."); + println!( + "Add above snippet to system's repository entries (/etc/apt/sources.list.d/) manually to configure." + ); } println!("Now run 'apt update && apt full-upgrade' to upgrade system."); diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs index c3eb902..2da13f5 100644 --- a/src/bin/proxmox-offline-mirror.rs +++ b/src/bin/proxmox-offline-mirror.rs @@ -3,12 +3,12 @@ use std::io::IsTerminal; use std::matches; use std::path::Path; -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use proxmox_offline_mirror::config::SubscriptionKey; use proxmox_offline_mirror::subscription::{extract_mirror_key, refresh_mirror_key}; use serde_json::Value; -use proxmox_router::cli::{run_cli_command, CliCommand, CliCommandMap, CliEnvironment}; +use proxmox_router::cli::{CliCommand, CliCommandMap, CliEnvironment, run_cli_command}; use proxmox_schema::api; use proxmox_section_config::SectionConfigData; use proxmox_subscription::ProductType; @@ -17,7 +17,7 @@ use proxmox_offline_mirror::helpers::tty::{ read_bool_from_tty, read_selection_from_tty, read_string_from_tty, }; use proxmox_offline_mirror::{ - config::{save_config, MediaConfig, MirrorConfig, SkipConfig}, + config::{MediaConfig, MirrorConfig, SkipConfig, save_config}, mirror, types::{MEDIA_ID_SCHEMA, MIRROR_ID_SCHEMA}, }; @@ -350,15 +350,33 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er // TODO enterprise query for key! let url = match (release, variant) { - (Release::Bookworm, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} bookworm {product}-enterprise"), - (Release::Bookworm, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} bookworm {product}-no-subscription"), - (Release::Bookworm, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} bookworm {product}test"), - (Release::Bullseye, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} bullseye {product}-enterprise"), - (Release::Bullseye, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} bullseye {product}-no-subscription"), - (Release::Bullseye, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} bullseye {product}test"), - (Release::Buster, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} buster {product}-enterprise"), - (Release::Buster, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} buster {product}-no-subscription"), - (Release::Buster, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} buster {product}test"), + (Release::Bookworm, ProxmoxVariant::Enterprise) => format!( + "https://enterprise.proxmox.com/debian/{product} bookworm {product}-enterprise" + ), + (Release::Bookworm, ProxmoxVariant::NoSubscription) => format!( + "http://download.proxmox.com/debian/{product} bookworm {product}-no-subscription" + ), + (Release::Bookworm, ProxmoxVariant::Test) => format!( + "http://download.proxmox.com/debian/{product} bookworm {product}test" + ), + (Release::Bullseye, ProxmoxVariant::Enterprise) => format!( + "https://enterprise.proxmox.com/debian/{product} bullseye {product}-enterprise" + ), + (Release::Bullseye, ProxmoxVariant::NoSubscription) => format!( + "http://download.proxmox.com/debian/{product} bullseye {product}-no-subscription" + ), + (Release::Bullseye, ProxmoxVariant::Test) => format!( + "http://download.proxmox.com/debian/{product} bullseye {product}test" + ), + (Release::Buster, ProxmoxVariant::Enterprise) => format!( + "https://enterprise.proxmox.com/debian/{product} buster {product}-enterprise" + ), + (Release::Buster, ProxmoxVariant::NoSubscription) => format!( + "http://download.proxmox.com/debian/{product} buster {product}-no-subscription" + ), + (Release::Buster, ProxmoxVariant::Test) => { + format!("http://download.proxmox.com/debian/{product} buster {product}test") + } }; use_subscription = match (product, variant) { @@ -442,7 +460,9 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er }; if !Path::new(&key_path).exists() { - eprintln!("Keyfile '{key_path}' doesn't exist - make sure to install relevant keyring packages or update config to provide correct path!"); + eprintln!( + "Keyfile '{key_path}' doesn't exist - make sure to install relevant keyring packages or update config to provide correct path!" + ); } let id = loop { @@ -476,7 +496,10 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er "Should already mirrored files be re-verified when updating the mirror? (io-intensive!)", Some(true), )?; - let sync = read_bool_from_tty("Should newly written files be written using FSYNC to ensure crash-consistency? (io-intensive!)", Some(true))?; + let sync = read_bool_from_tty( + "Should newly written files be written using FSYNC to ensure crash-consistency? (io-intensive!)", + Some(true), + )?; let mut configs = Vec::with_capacity(extra_repos.len() + 1); @@ -672,7 +695,10 @@ fn action_add_medium(config: &SectionConfigData) -> Result { "Should mirrored files be re-verified when updating the medium? (io-intensive!)", Some(true), )?; - let sync = read_bool_from_tty("Should newly written files be written using FSYNC to ensure crash-consistency? (io-intensive!)", Some(true))?; + let sync = read_bool_from_tty( + "Should newly written files be written using FSYNC to ensure crash-consistency? (io-intensive!)", + Some(true), + )?; Ok(MediaConfig { id, @@ -845,7 +871,9 @@ async fn setup(config: Option, _param: Value) -> Result<(), Error> { config.set_data(&id, "mirror", mirror_config)?; save_config(&config_file, &config)?; println!("Config entry '{id}' added"); - println!("Run \"proxmox-offline-mirror mirror snapshot create --config '{config_file}' '{id}'\" to create a new mirror snapshot."); + println!( + "Run \"proxmox-offline-mirror mirror snapshot create --config '{config_file}' '{id}'\" to create a new mirror snapshot." + ); } } Action::AddMedium => { @@ -854,7 +882,9 @@ async fn setup(config: Option, _param: Value) -> Result<(), Error> { config.set_data(&id, "medium", media_config)?; save_config(&config_file, &config)?; println!("Config entry '{id}' added"); - println!("Run \"proxmox-offline-mirror medium sync --config '{config_file}' '{id}'\" to sync mirror snapshots to medium."); + println!( + "Run \"proxmox-offline-mirror medium sync --config '{config_file}' '{id}'\" to sync mirror snapshots to medium." + ); } Action::AddKey => { let key = action_add_key(&config)?; @@ -862,7 +892,9 @@ async fn setup(config: Option, _param: Value) -> Result<(), Error> { config.set_data(&id, "subscription", &key)?; save_config(&config_file, &config)?; println!("Config entry '{id}' added"); - println!("Run \"proxmox-offline-mirror key refresh\" to refresh subscription information"); + println!( + "Run \"proxmox-offline-mirror key refresh\" to refresh subscription information" + ); } } } diff --git a/src/bin/proxmox_offline_mirror_cmds/config.rs b/src/bin/proxmox_offline_mirror_cmds/config.rs index d0d9756..57388c7 100644 --- a/src/bin/proxmox_offline_mirror_cmds/config.rs +++ b/src/bin/proxmox_offline_mirror_cmds/config.rs @@ -1,13 +1,13 @@ use std::{env, fs::remove_dir_all, path::Path}; -use anyhow::{bail, Error}; +use anyhow::{Error, bail}; use serde_json::Value; use proxmox_router::cli::{ - default_table_format_options, format_and_print_result_full, get_output_format, CliCommand, - CliCommandMap, ColumnConfig, CommandLineInterface, OUTPUT_FORMAT, + CliCommand, CliCommandMap, ColumnConfig, CommandLineInterface, OUTPUT_FORMAT, + default_table_format_options, format_and_print_result_full, get_output_format, }; -use proxmox_schema::{api, param_bail, ApiType, ArraySchema, ReturnType}; +use proxmox_schema::{ApiType, ArraySchema, ReturnType, api, param_bail}; use proxmox_offline_mirror::{ config::{MediaConfig, MediaConfigUpdater, MirrorConfig, MirrorConfigUpdater}, diff --git a/src/bin/proxmox_offline_mirror_cmds/medium.rs b/src/bin/proxmox_offline_mirror_cmds/medium.rs index 3f05d43..9988156 100644 --- a/src/bin/proxmox_offline_mirror_cmds/medium.rs +++ b/src/bin/proxmox_offline_mirror_cmds/medium.rs @@ -14,7 +14,7 @@ use proxmox_offline_mirror::{ generate_repo_file_line, medium::{self}, mirror, - types::{Snapshot, MEDIA_ID_SCHEMA}, + types::{MEDIA_ID_SCHEMA, Snapshot}, }; use super::get_config_path; diff --git a/src/bin/proxmox_offline_mirror_cmds/mirror.rs b/src/bin/proxmox_offline_mirror_cmds/mirror.rs index 07db92f..31a565e 100644 --- a/src/bin/proxmox_offline_mirror_cmds/mirror.rs +++ b/src/bin/proxmox_offline_mirror_cmds/mirror.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use proxmox_section_config::SectionConfigData; use proxmox_subscription::SubscriptionStatus; @@ -9,15 +9,15 @@ use std::{ }; use proxmox_router::cli::{ - format_and_print_result, get_output_format, CliCommand, CliCommandMap, CommandLineInterface, - OUTPUT_FORMAT, + CliCommand, CliCommandMap, CommandLineInterface, OUTPUT_FORMAT, format_and_print_result, + get_output_format, }; use proxmox_schema::api; use proxmox_offline_mirror::{ config::{MirrorConfig, SubscriptionKey}, mirror, - types::{Snapshot, MIRROR_ID_SCHEMA}, + types::{MIRROR_ID_SCHEMA, Snapshot}, }; use super::get_config_path; diff --git a/src/bin/proxmox_offline_mirror_cmds/subscription.rs b/src/bin/proxmox_offline_mirror_cmds/subscription.rs index 72275e6..8fec4b4 100644 --- a/src/bin/proxmox_offline_mirror_cmds/subscription.rs +++ b/src/bin/proxmox_offline_mirror_cmds/subscription.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use serde::Serialize; use serde_json::Value; @@ -9,15 +9,15 @@ use proxmox_offline_mirror::{ subscription::{extract_mirror_key, refresh_mirror_key, refresh_offline_keys}, types::PROXMOX_SUBSCRIPTION_KEY_SCHEMA, }; -use proxmox_subscription::{files::DEFAULT_SIGNING_KEY, ProductType, SubscriptionStatus}; +use proxmox_subscription::{ProductType, SubscriptionStatus, files::DEFAULT_SIGNING_KEY}; use proxmox_sys::fs::file_get_contents; use proxmox_time::epoch_to_rfc3339_utc; use proxmox_router::cli::{ - default_table_format_options, format_and_print_result_full, get_output_format, CliCommand, - CliCommandMap, ColumnConfig, CommandLineInterface, OUTPUT_FORMAT, + CliCommand, CliCommandMap, ColumnConfig, CommandLineInterface, OUTPUT_FORMAT, + default_table_format_options, format_and_print_result_full, get_output_format, }; -use proxmox_schema::{api, param_bail, ApiType, ArraySchema, ReturnType}; +use proxmox_schema::{ApiType, ArraySchema, ReturnType, api, param_bail}; use super::get_config_path; diff --git a/src/config.rs b/src/config.rs index 2995402..c1b0330 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,14 +1,14 @@ use std::path::Path; use std::sync::LazyLock; -use anyhow::{bail, Error}; -use proxmox_subscription::{sign::ServerBlob, SubscriptionInfo}; +use anyhow::{Error, bail}; +use proxmox_subscription::{SubscriptionInfo, sign::ServerBlob}; use serde::{Deserialize, Serialize}; -use proxmox_schema::{api, ApiStringFormat, ApiType, Updater}; +use proxmox_schema::{ApiStringFormat, ApiType, Updater, api}; use proxmox_section_config::{SectionConfig, SectionConfigData, SectionConfigPlugin}; use proxmox_subscription::ProductType; -use proxmox_sys::fs::{replace_file, CreateOptions}; +use proxmox_sys::fs::{CreateOptions, replace_file}; use crate::types::{ MEDIA_ID_SCHEMA, MIRROR_ID_SCHEMA, PROXMOX_SERVER_ID_SCHEMA, PROXMOX_SUBSCRIPTION_KEY_SCHEMA, diff --git a/src/helpers/tty.rs b/src/helpers/tty.rs index 7ef5469..00f9a6b 100644 --- a/src/helpers/tty.rs +++ b/src/helpers/tty.rs @@ -1,6 +1,6 @@ use std::io::Write; -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use proxmox_schema::parse_boolean; /// Prints `query`, reads string from terminal, defaulting to `default`. diff --git a/src/helpers/verifier.rs b/src/helpers/verifier.rs index 5a0aa37..85ca195 100644 --- a/src/helpers/verifier.rs +++ b/src/helpers/verifier.rs @@ -1,17 +1,17 @@ -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use sequoia_openpgp::{ + Cert, KeyHandle, cert::CertParser, parse::{ + PacketParser, PacketParserResult, Parse, stream::{ DetachedVerifierBuilder, MessageLayer, MessageStructure, VerificationError, VerificationHelper, VerifierBuilder, }, - PacketParser, PacketParserResult, Parse, }, policy::StandardPolicy, types::HashAlgorithm, - Cert, KeyHandle, }; use std::io; diff --git a/src/lib.rs b/src/lib.rs index 8d5ca3f..cd444d4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ use std::{ path::Path, }; -use anyhow::{format_err, Error}; +use anyhow::{Error, format_err}; use medium::MirrorInfo; use proxmox_apt::repositories::{APTRepositoryFileImpl, APTRepositoryImpl}; use proxmox_apt_api_types::{APTRepository, APTRepositoryFile, APTRepositoryFileType}; diff --git a/src/medium.rs b/src/medium.rs index 53df50d..bef6cc7 100644 --- a/src/medium.rs +++ b/src/medium.rs @@ -5,11 +5,11 @@ use std::{ path::{Path, PathBuf}, }; -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use nix::libc; use openssl::sha::sha256; use proxmox_subscription::SubscriptionInfo; -use proxmox_sys::fs::{file_get_contents, replace_file, CreateOptions}; +use proxmox_sys::fs::{CreateOptions, file_get_contents, replace_file}; use proxmox_time::{epoch_i64, epoch_to_rfc3339_utc}; use serde::{Deserialize, Serialize}; @@ -18,7 +18,7 @@ use crate::{ generate_repo_file_line, mirror::pool, pool::Pool, - types::{Diff, Snapshot, SNAPSHOT_REGEX}, + types::{Diff, SNAPSHOT_REGEX, Snapshot}, }; #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] @@ -420,13 +420,17 @@ pub fn sync( if mirror_base.exists() { match pools.get(&dropped) { Some(pool) => { - println!("Removing previously synced, but no longer configured mirror '{dropped}'.."); + println!( + "Removing previously synced, but no longer configured mirror '{dropped}'.." + ); let mut pool_dir = medium_base.to_path_buf(); pool_dir.push(pool); let pool = Pool::open(&mirror_base, &pool_dir)?; pool.lock()?.destroy()?; - }, - None => bail!("No pool information for previously synced, but no longer configured mirror '{dropped}'"), + } + None => bail!( + "No pool information for previously synced, but no longer configured mirror '{dropped}'" + ), } } } diff --git a/src/mirror.rs b/src/mirror.rs index b56c33c..c88f81d 100644 --- a/src/mirror.rs +++ b/src/mirror.rs @@ -5,20 +5,20 @@ use std::{ path::{Path, PathBuf}, }; -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use flate2::bufread::GzDecoder; use globset::{Glob, GlobSet, GlobSetBuilder}; use nix::libc; -use proxmox_http::{client::sync::Client, HttpClient, HttpOptions, ProxyConfig}; +use proxmox_http::{HttpClient, HttpOptions, ProxyConfig, client::sync::Client}; use proxmox_schema::{ApiType, Schema}; use proxmox_sys::fs::file_get_contents; use crate::{ + FetchResult, Progress, config::{MirrorConfig, SkipConfig, SubscriptionKey, WeakCryptoConfig}, convert_repo_line, pool::Pool, - types::{Diff, Snapshot, SNAPSHOT_REGEX}, - FetchResult, Progress, + types::{Diff, SNAPSHOT_REGEX, Snapshot}, }; use proxmox_apt::deb822::{ diff --git a/src/pool.rs b/src/pool.rs index 7db976e..62dbbee 100644 --- a/src/pool.rs +++ b/src/pool.rs @@ -1,17 +1,17 @@ use std::{ cmp::max, - collections::{hash_map::Entry, HashMap}, - fs::{hard_link, File, Metadata}, + collections::{HashMap, hash_map::Entry}, + fs::{File, Metadata, hard_link}, ops::Deref, os::linux::fs::MetadataExt, path::{Path, PathBuf}, }; -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use nix::unistd; use proxmox_apt::deb822::CheckSums; -use proxmox_sys::fs::{create_path, file_get_contents, replace_file, CreateOptions}; +use proxmox_sys::fs::{CreateOptions, create_path, file_get_contents, replace_file}; use proxmox_time::epoch_i64; use walkdir::WalkDir; @@ -298,7 +298,9 @@ impl PoolLockGuard<'_> { if checked_link_count % progress_modulo == 0 || last_progress + 30 < epoch_i64() { last_progress = epoch_i64(); - println!("Progress: checked {checked_link_count} links; added {added_count} files ({added_size}b) / {link_count} links to target pool"); + println!( + "Progress: checked {checked_link_count} links; added {added_count} files ({added_size}b) / {link_count} links to target pool" + ); } } println!( @@ -350,7 +352,9 @@ impl PoolLockGuard<'_> { println!("None found.") } - println!("Syncing done: added {added_count} files ({added_size}b) / {link_count} links to target pool"); + println!( + "Syncing done: added {added_count} files ({added_size}b) / {link_count} links to target pool" + ); Ok(()) } diff --git a/src/subscription.rs b/src/subscription.rs index 3f0c776..fc80a6f 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -1,11 +1,11 @@ -use anyhow::{bail, format_err, Error}; +use anyhow::{Error, bail, format_err}; use proxmox_http::client::sync::Client; use proxmox_http::{HttpClient, HttpOptions, ProxyConfig}; use proxmox_subscription::SubscriptionStatus; use proxmox_subscription::{ - sign::{SignRequest, SignedResponse}, ProductType, SubscriptionInfo, + sign::{SignRequest, SignedResponse}, }; use crate::config::SubscriptionKey; diff --git a/src/types.rs b/src/types.rs index 7544d5e..10dde65 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,7 +1,7 @@ use std::{fmt::Display, path::PathBuf, str::FromStr}; use anyhow::Error; -use proxmox_schema::{api, const_regex, ApiStringFormat, Schema, StringSchema}; +use proxmox_schema::{ApiStringFormat, Schema, StringSchema, api, const_regex}; use proxmox_serde::{forward_deserialize_to_from_str, forward_serialize_to_display}; use proxmox_time::{epoch_i64, epoch_to_rfc3339_utc, parse_rfc3339}; -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel