From: Robert Obkircher <r.obkircher@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH v1 proxmox-backup 08/11] client: catalog shell: avoid unnecessary block_on in async code
Date: Thu, 26 Feb 2026 15:40:22 +0100 [thread overview]
Message-ID: <20260226144033.211039-9-r.obkircher@proxmox.com> (raw)
In-Reply-To: <20260226144033.211039-1-r.obkircher@proxmox.com>
Prefer normal async/await over block_on. The signature of the "pub"
new method can be changed because it is implemented on a private type.
Signed-off-by: Robert Obkircher <r.obkircher@proxmox.com>
---
pbs-client/src/catalog_shell.rs | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/pbs-client/src/catalog_shell.rs b/pbs-client/src/catalog_shell.rs
index 5e1835e4..43f0a73b 100644
--- a/pbs-client/src/catalog_shell.rs
+++ b/pbs-client/src/catalog_shell.rs
@@ -1080,7 +1080,8 @@ impl Shell {
extractor,
match_list,
&self.accessor,
- )?;
+ )
+ .await?;
extractor.extract().await
}
@@ -1119,7 +1120,7 @@ struct ExtractorState<'a> {
}
impl<'a> ExtractorState<'a> {
- pub fn new(
+ pub async fn new(
catalog: &'a mut Option<CatalogReader>,
dir_stack: Vec<PathStackEntry>,
extractor: crate::pxar::extract::Extractor,
@@ -1132,8 +1133,8 @@ impl<'a> ExtractorState<'a> {
.into_iter()
} else {
let pxar_entry = parent_pxar_entry(&dir_stack)?;
- let dir = block_on(pxar_entry.enter_directory())?;
- let entries = block_on(crate::pxar::tools::pxar_metadata_read_dir(dir))?;
+ let dir = pxar_entry.enter_directory().await?;
+ let entries = crate::pxar::tools::pxar_metadata_read_dir(dir).await?;
let mut catalog_entries = Vec::with_capacity(entries.len());
for entry in entries {
@@ -1229,7 +1230,7 @@ impl<'a> ExtractorState<'a> {
let dir = Shell::walk_pxar_archive(self.accessor, &mut self.dir_stack).await?;
self.dir_stack.pop();
let dir = dir.enter_directory().await?;
- let entries = block_on(crate::pxar::tools::pxar_metadata_read_dir(dir))?;
+ let entries = crate::pxar::tools::pxar_metadata_read_dir(dir).await?;
entries
.into_iter()
.map(|entry| {
--
2.47.3
next prev parent reply other threads:[~2026-02-26 14:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 14:40 [PATCH v1 proxmox-backup 00/11] fix various warnings Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 01/11] datastore: remove allow(clippy::cast_ptr_alignment) attribute Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 02/11] api: use checked_div for compression ratio calculation Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 03/11] datastore+server: sort by key instead of using comparison functions Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 04/11] api: remove unnecessary ampersand to fix clippy warning Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 05/11] bin: debug: use pattern match instead of is_some+unwrap Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 06/11] bin: proxy: fix clippy warning about unnecesary use of find_map Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 07/11] datastore: silence warning about too many arguments Robert Obkircher
2026-02-26 14:40 ` Robert Obkircher [this message]
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 09/11] client: catalog shell: combine multiple block_on calls into one Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 10/11] client: catalog shell: avoid unsafe transmute Robert Obkircher
2026-02-26 14:40 ` [PATCH v1 proxmox-backup 11/11] tape: media catalog: use Flock wrapper instead of deprecated function Robert Obkircher
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=20260226144033.211039-9-r.obkircher@proxmox.com \
--to=r.obkircher@proxmox.com \
--cc=pbs-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