[pbs-devel] [PATCH proxmox-backup(-qemu) 00/17] clippy refactorings

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Jan 25 14:42:45 CET 2021


various parameter/types refactorings to simplify function
signatures/return types/...

I am grateful for suggestions on better names ;)

I tried to order/group the patches so that they also apply
individually/as sub-groups.

with all of these, we are now down to some very recently touched files
with trivial fixes that I didn't want to change since I suspected them
to be still under development, and one missing docs lint:

warning: unsafe function's docs miss `# Safety` section
  --> src/tools/fs.rs:78:5
   |
78 | /     pub unsafe fn file_name_utf8_unchecked(&self) -> &str {
79 | |         std::str::from_utf8_unchecked(self.file_name().to_bytes())
80 | |     }
   | |_____^

proxmox-backup:
  report: type-alias function call tuple
  broadcast_future: refactor broadcast/future binding
  client: refactor catalog upload spawning
  allow complex Futures in tower_service impl
  async index reader: typedef ReadFuture
  systemd/time: extract Time/DateSpec structs
  client: factor out UploadOptions
  pxar: typedef on_error as ErrorHandler
  pxar: factor out PxarCreateOptions
  pxar: extract PxarExtractOptions
  authid: make Tokenname(Ref) derive Eq
  derive/impl and use Default for some structs
  verify: factor out common parameters
  clippy: allow api functions with many arguments
  clippy: more misc fixes

 examples/download-speed.rs             |   2 +-
 examples/upload-speed.rs               |   2 +-
 src/api2/access/acl.rs                 |   1 +
 src/api2/access/tfa.rs                 |   1 +
 src/api2/access/user.rs                |   1 +
 src/api2/admin/datastore.rs            |  19 +--
 src/api2/backup/environment.rs         |  10 +-
 src/api2/config/datastore.rs           |   1 +
 src/api2/config/remote.rs              |   5 +-
 src/api2/config/sync.rs                |   1 +
 src/api2/config/verify.rs              |   1 +
 src/api2/node/network.rs               |   2 +
 src/api2/node/tasks.rs                 |   1 +
 src/api2/types/userid.rs               |  52 +-------
 src/backup/async_index_reader.rs       |   4 +-
 src/backup/prune.rs                    |   1 +
 src/backup/verify.rs                   | 174 +++++++++++--------------
 src/bin/proxmox-backup-client.rs       | 162 +++++++++++++----------
 src/bin/proxmox-daily-update.rs        |   9 +-
 src/bin/proxmox_backup_client/key.rs   |  24 +---
 src/bin/proxmox_backup_client/mount.rs |   2 +-
 src/bin/proxmox_backup_manager/user.rs |   4 +-
 src/bin/pxar.rs                        |  54 ++++----
 src/client.rs                          |  11 +-
 src/client/backup_writer.rs            |  46 ++++---
 src/client/http_client.rs              |  38 ++++--
 src/client/pull.rs                     |   4 +-
 src/client/pxar_backup_stream.rs       |  28 +---
 src/config/acl.rs                      |   8 +-
 src/config/network.rs                  |   2 +-
 src/pxar/create.rs                     |  28 +++-
 src/pxar/extract.rs                    |  24 ++--
 src/pxar/mod.rs                        |   4 +-
 src/rrd/mod.rs                         |   1 +
 src/server/h2service.rs                |   5 +-
 src/server/report.rs                   |   6 +-
 src/server/rest.rs                     |   3 +-
 src/server/verify_job.rs               |   3 +-
 src/tools/broadcast_future.rs          |  38 ++----
 src/tools/http.rs                      |   5 +-
 src/tools/systemd/parse_time.rs        |  41 ++++--
 tests/catar.rs                         |  10 +-
 42 files changed, 414 insertions(+), 424 deletions(-)

proxmox-backup-qemu:
  use UploadOptions for uploading Blobs
  use new HttpClientOptions constructors

 src/backup.rs   |  7 ++++---
 src/commands.rs | 15 +++++++++++++--
 src/lib.rs      |  8 +++++---
 src/restore.rs  |  7 ++++---
 4 files changed, 26 insertions(+), 11 deletions(-)

-- 
2.20.1






More information about the pbs-devel mailing list