From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 3/6] s3 client: refactor list buckets result list fetching
Date: Mon, 4 Aug 2025 18:09:34 +0200 [thread overview]
Message-ID: <20250804160937.660470-4-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250804160937.660470-1-c.ebner@proxmox.com>
Instead of the match statement, use the more concise map and
unwrap_or_default.
No fuctional changes intended.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
proxmox-s3-client/src/response_reader.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/proxmox-s3-client/src/response_reader.rs b/proxmox-s3-client/src/response_reader.rs
index 0172805c..fc9519ad 100644
--- a/proxmox-s3-client/src/response_reader.rs
+++ b/proxmox-s3-client/src/response_reader.rs
@@ -385,10 +385,10 @@ impl ResponseReader {
let list_buckets_result: ListAllMyBucketsResult =
serde_xml_rs::from_str(&body).context("failed to parse response body")?;
- let buckets = match list_buckets_result.buckets {
- Some(buckets) => buckets.bucket,
- None => Vec::new(),
- };
+ let buckets = list_buckets_result
+ .buckets
+ .map(|b| b.bucket)
+ .unwrap_or_default();
Ok(ListBucketsResponse { buckets })
}
--
2.47.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2025-08-04 16:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 16:09 [pbs-devel] [PATCH proxmox 0/6] followups and cleanups for s3 client Christian Ebner
2025-08-04 16:09 ` [pbs-devel] [PATCH proxmox 1/6] s3 client: fix formatting issues by `cargo fmt` Christian Ebner
2025-08-04 16:09 ` [pbs-devel] [PATCH proxmox 2/6] s3 client: refactor list buckets response status code matching Christian Ebner
2025-08-04 16:09 ` Christian Ebner [this message]
2025-08-04 16:09 ` [pbs-devel] [PATCH proxmox 4/6] s3 client: add doc comments for response parser helper methods Christian Ebner
2025-08-04 16:09 ` [pbs-devel] [PATCH proxmox 5/6] s3 client: add and expand doc comments for response parsing objects Christian Ebner
2025-08-04 16:09 ` [pbs-devel] [PATCH proxmox 6/6] s3 client: add basic regression tests for response parsing Christian Ebner
2025-08-04 20:18 ` [pbs-devel] [PATCH proxmox 0/6] followups and cleanups for s3 client Thomas Lamprecht
2025-08-04 20:18 ` [pve-devel] " Thomas Lamprecht
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=20250804160937.660470-4-c.ebner@proxmox.com \
--to=c.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.