[pbs-devel] [PATCH proxmox-backup 2/2] backup-client: change imports to not use '*'
Mira Limbeck
m.limbeck at proxmox.com
Fri Jul 17 17:43:48 CEST 2020
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 at 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
More information about the pbs-devel
mailing list