From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 67B4D1FF13F for ; Thu, 21 May 2026 14:57:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5A80611E43; Thu, 21 May 2026 14:57:17 +0200 (CEST) Date: Thu, 21 May 2026 14:57:12 +0200 From: Wolfgang Bumiller To: Lukas Wagner Subject: Re: [PATCH datacenter-manager 3/3] clippy: sdn-client: fix 'large size difference between variants' for error type Message-ID: References: <20260520131348.332987-1-l.wagner@proxmox.com> <20260520131348.332987-4-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260520131348.332987-4-l.wagner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779368215864 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.087 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: WLOBVIQ6GLYJ3SGI7J57N3PNZJ2ENIZ5 X-Message-ID-Hash: WLOBVIQ6GLYJ3SGI7J57N3PNZJ2ENIZ5 X-MailFrom: w.bumiller@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pdm-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The problem here is actually in `proxmox-client` - its `Error::TfaRequired` should be boxed. You'll see the same clippy warning when running `cargo clippy --all-features` in `proxmox.git`'s `proxmox-client/` dir. On Wed, May 20, 2026 at 03:13:47PM +0200, Lukas Wagner wrote: > Signed-off-by: Lukas Wagner > --- > > Notes: > Not sure if we should just add an ignore instead > > server/src/sdn_client.rs | 27 ++++++++++++++++----------- > 1 file changed, 16 insertions(+), 11 deletions(-) > > diff --git a/server/src/sdn_client.rs b/server/src/sdn_client.rs > index 95e4d69b..f56519a6 100644 > --- a/server/src/sdn_client.rs > +++ b/server/src/sdn_client.rs > @@ -2,7 +2,7 @@ use std::error::Error as StdError; > use std::sync::Arc; > use std::time::Duration; > > -use anyhow::{self, bail, Context}; > +use anyhow::{self, bail, format_err, Context}; > > use futures::{future::join_all, stream::FuturesUnordered, StreamExt, TryFutureExt}; > use pdm_api_types::{remotes::Remote, RemoteUpid}; > @@ -25,7 +25,7 @@ pub struct LockedSdnClient { > > #[derive(Debug)] > pub enum LockedSdnClientError { > - Client(proxmox_client::Error), > + Client(Box), > Other(anyhow::Error), > } > > @@ -49,7 +49,7 @@ impl std::fmt::Display for LockedSdnClientError { > > impl From for LockedSdnClientError { > fn from(value: proxmox_client::Error) -> Self { > - Self::Client(value) > + Self::Client(Box::new(value)) > } > } > > @@ -219,15 +219,20 @@ impl LockedSdnClients { > } > } > > - return match &error { > - LockedSdnClientError::Client(proxmox_client::Error::Api(status, _msg)) > - if *status == 501 => > - { > - bail!("remote {} does not support the sdn locking api, please upgrade to PVE 9 or newer!", remote.id) > + return match error { > + LockedSdnClientError::Client(error) => match *error { > + proxmox_client::Error::Api(status_code, _msg) if status_code == 501 => { > + Err(format_err!("remote {} does not support the sdn locking api, please upgrade to PVE 9 or newer!", remote.id)) > + } > + _ => Err(error).with_context(|| format!( > + "could not lock sdn configuration for remote {}", > + remote.id > + )), > } > - _ => Err(error).with_context(|| { > - format!("could not lock sdn configuration for remote {}", remote.id) > - }), > + _ => Err(error).with_context(|| format!( > + "could not lock sdn configuration for remote {}", > + remote.id > + )), > }; > } > }; > -- > 2.47.3 > > > > > --