From: "Gabriel Goller" <g.goller@proxmox.com>
To: "Proxmox Backup Server development discussion"
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 4/4] pxar: use anyhow::Error in PxarBackupStream
Date: Mon, 19 Feb 2024 11:53:48 +0100 [thread overview]
Message-ID: <CZ8ZZYYOUWPK.2M6MNWHGAJNXG@proxmox.com> (raw)
In-Reply-To: <e3fee3e7-697a-496f-93a7-02d0e3121ebd@proxmox.com>
On Fri Feb 16, 2024 at 6:47 PM CET, Max Carrara wrote:
> On 2/16/24 16:33, Gabriel Goller wrote:
> > + let mut error = self.error.lock().unwrap();
> > + if error.is_some() {
> > + let err = error.take().unwrap();
> > + return Poll::Ready(Some(Err(err)));
> > }
>
> ... could be replaced with the following:
>
> let mut error = self.error.lock().unwrap();
> if let Some(err) = error.take() {
> return Poll::Ready(Some(Err(err)));
> }
>
> `Option::take()` also returns an `Option`, allowing you to omit the `unwrap()`.
Good point!
Will be fixed in the next version!
next prev parent reply other threads:[~2024-02-19 10:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-16 15:33 [pbs-devel] [PATCH proxmox{, -backup} 0/4] output full anyhow context in client Gabriel Goller
2024-02-16 15:33 ` [pbs-devel] [PATCH proxmox 1/4] CLI: print fatal errors including causes Gabriel Goller
2024-02-16 15:33 ` [pbs-devel] [PATCH proxmox-backup 2/4] pxar: remove ArchiveError Gabriel Goller
2024-02-16 15:33 ` [pbs-devel] [PATCH proxmox-backup 3/4] pxar: add UniqueContext helper Gabriel Goller
2024-02-16 17:44 ` Max Carrara
2024-02-16 15:33 ` [pbs-devel] [PATCH proxmox-backup 4/4] pxar: use anyhow::Error in PxarBackupStream Gabriel Goller
2024-02-16 17:47 ` Max Carrara
2024-02-19 10:53 ` Gabriel Goller [this message]
2024-02-16 17:49 ` [pbs-devel] [PATCH proxmox{, -backup} 0/4] output full anyhow context in client Max Carrara
2024-02-16 17:55 ` Max Carrara
2024-02-19 10:54 ` Gabriel Goller
2024-02-20 10:30 ` Gabriel Goller
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=CZ8ZZYYOUWPK.2M6MNWHGAJNXG@proxmox.com \
--to=g.goller@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.