From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3620C63EE7 for ; Fri, 17 Jul 2020 17:43:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 211CC1DA80 for ; Fri, 17 Jul 2020 17:43:24 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id BA1E01DA6D for ; Fri, 17 Jul 2020 17:43:22 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8183042ECE for ; Fri, 17 Jul 2020 17:43:22 +0200 (CEST) From: Mira Limbeck To: pve-devel@lists.proxmox.com Date: Fri, 17 Jul 2020 17:43:20 +0200 Message-Id: <20200717154320.2627-2-m.limbeck@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200717154320.2627-1-m.limbeck@proxmox.com> References: <20200717154320.2627-1-m.limbeck@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.461 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.379 Envelope sender has no MX or A DNS records RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mod.rs, proxmox-backup-client.rs] Subject: [pve-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*' X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 15:43:54 -0000 Import the required symbols directly instead of importing everything there is with '*'. This makes it clear which symbol is exported by which crate and module. Signed-off-by: Mira Limbeck --- Only proxmox_backup::client and proxmox_backup_client have been changed to import via the submodule namespace, not directly. As for the others, those would probably require lots of changes as many files depend on them. But because this is probably a controversial change, I'd rather get the opinion of others before committing to changing them. The previous and this patch are in preparation of separating the proxmox-backup-client from the proxmox-backup crate. src/bin/proxmox-backup-client.rs | 21 ++++++++++++++++----- src/bin/proxmox_backup_client/mod.rs | 12 ++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index 147eeba6..53fc84fb 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -18,13 +18,21 @@ use xdg::BaseDirectories; use pathpatterns::{MatchEntry, MatchType, PatternFlag}; use proxmox::tools::fs::{file_get_contents, file_get_json, replace_file, CreateOptions, image_size}; use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment}; -use proxmox::api::schema::*; -use proxmox::api::cli::*; +use proxmox::api::schema::{BooleanSchema, IntegerSchema, ObjectSchema, Schema, StringSchema}; +use proxmox::api::cli::{ + default_table_format_options, format_and_print_result, format_and_print_result_full, + get_output_format, run_cli_command, CliCommand, CliCommandMap, CliEnvironment, ColumnConfig, + OUTPUT_FORMAT, +}; use proxmox::api::api; use pxar::accessor::{MaybeReady, ReadAt, ReadAtOperation}; use proxmox_backup::tools; -use proxmox_backup::api2::types::*; +use proxmox_backup::api2::types::{ + GroupListItem, PruneListItem, SnapshotListItem, BACKUP_ID_SCHEMA, BACKUP_TIME_SCHEMA, + BACKUP_TYPE_SCHEMA, PRUNE_SCHEMA_KEEP_DAILY, PRUNE_SCHEMA_KEEP_HOURLY, PRUNE_SCHEMA_KEEP_LAST, + PRUNE_SCHEMA_KEEP_MONTHLY, PRUNE_SCHEMA_KEEP_WEEKLY, PRUNE_SCHEMA_KEEP_YEARLY, +}; use proxmox_backup::api2::version; use proxmox_backup::client::{ backup_reader::BackupReader, @@ -37,7 +45,7 @@ use proxmox_backup::client::{ pxar_backup_stream::PxarBackupStream, task_log::display_task_log, }; -use proxmox_backup::pxar::catalog::*; +use proxmox_backup::pxar::catalog::BackupCatalogWriter; use proxmox_backup::backup::{ archive_type, decrypt_key, @@ -64,7 +72,10 @@ use proxmox_backup::backup::{ }; mod proxmox_backup_client; -use proxmox_backup_client::*; +use proxmox_backup_client::{ + benchmark::API_METHOD_BENCHMARK, catalog::catalog_mgmt_cli, key, mount::mount_cmd_def, + task::task_mgmt_cli, +}; const ENV_VAR_PBS_FINGERPRINT: &str = "PBS_FINGERPRINT"; const ENV_VAR_PBS_PASSWORD: &str = "PBS_PASSWORD"; diff --git a/src/bin/proxmox_backup_client/mod.rs b/src/bin/proxmox_backup_client/mod.rs index 0c4bffb9..b565a633 100644 --- a/src/bin/proxmox_backup_client/mod.rs +++ b/src/bin/proxmox_backup_client/mod.rs @@ -1,13 +1,9 @@ use anyhow::{Context, Error}; -mod benchmark; -pub use benchmark::*; -mod mount; -pub use mount::*; -mod task; -pub use task::*; -mod catalog; -pub use catalog::*; +pub mod benchmark; +pub mod mount; +pub mod task; +pub mod catalog; pub mod key; -- 2.20.1