public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*'
Date: Fri, 17 Jul 2020 17:43:20 +0200	[thread overview]
Message-ID: <20200717154320.2627-2-m.limbeck@proxmox.com> (raw)
In-Reply-To: <20200717154320.2627-1-m.limbeck@proxmox.com>

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 <m.limbeck@proxmox.com>
---
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





  reply	other threads:[~2020-07-17 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 15:43 [pve-devel] [PATCH proxmox-backup 1/2] change * imports of proxmox_backup::client Mira Limbeck
2020-07-17 15:43 ` Mira Limbeck [this message]
2020-07-17 15:44 ` Mira Limbeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200717154320.2627-2-m.limbeck@proxmox.com \
    --to=m.limbeck@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal