From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 47BD193B07 for ; Tue, 9 Apr 2024 15:26:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 934E91F1B3 for ; Tue, 9 Apr 2024 15:26:10 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 9 Apr 2024 15:26:07 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 14F81424F7 for ; Tue, 9 Apr 2024 15:26:07 +0200 (CEST) From: Lukas Wagner To: pve-devel@lists.proxmox.com Date: Tue, 9 Apr 2024 15:25:49 +0200 Message-Id: <20240409132555.364926-14-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240409132555.364926-1-l.wagner@proxmox.com> References: <20240409132555.364926-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.007 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 Subject: [pve-devel] [PATCH proxmox-perl-rs 13/19] notify: don't pass config structs by reference X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2024 13:26:14 -0000 proxmox_notify's api functions have been changed so that they take ownership of config structs. Signed-off-by: Lukas Wagner Tested-by: Folke Gleumes --- common/src/notify.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/src/notify.rs b/common/src/notify.rs index d965417..00a6056 100644 --- a/common/src/notify.rs +++ b/common/src/notify.rs @@ -151,7 +151,7 @@ mod export { api::sendmail::add_endpoint( &mut config, - &SendmailConfig { + SendmailConfig { name, mailto, mailto_user, @@ -185,7 +185,7 @@ mod export { api::sendmail::update_endpoint( &mut config, name, - &SendmailConfigUpdater { + SendmailConfigUpdater { mailto, mailto_user, from_address, @@ -236,7 +236,7 @@ mod export { let mut config = this.config.lock().unwrap(); api::gotify::add_endpoint( &mut config, - &GotifyConfig { + GotifyConfig { name: name.clone(), server, comment, @@ -244,7 +244,7 @@ mod export { filter: None, origin: None, }, - &GotifyPrivateConfig { name, token }, + GotifyPrivateConfig { name, token }, ) } @@ -266,12 +266,12 @@ mod export { api::gotify::update_endpoint( &mut config, name, - &GotifyConfigUpdater { + GotifyConfigUpdater { server, comment, disable, }, - &GotifyPrivateConfigUpdater { token }, + GotifyPrivateConfigUpdater { token }, delete.as_deref(), digest.as_deref(), ) @@ -323,7 +323,7 @@ mod export { let mut config = this.config.lock().unwrap(); api::smtp::add_endpoint( &mut config, - &SmtpConfig { + SmtpConfig { name: name.clone(), server, port, @@ -337,7 +337,7 @@ mod export { disable, origin: None, }, - &SmtpPrivateConfig { name, password }, + SmtpPrivateConfig { name, password }, ) } @@ -366,7 +366,7 @@ mod export { api::smtp::update_endpoint( &mut config, name, - &SmtpConfigUpdater { + SmtpConfigUpdater { server, port, mode, @@ -378,7 +378,7 @@ mod export { comment, disable, }, - &SmtpPrivateConfigUpdater { password }, + SmtpPrivateConfigUpdater { password }, delete.as_deref(), digest.as_deref(), ) @@ -427,7 +427,7 @@ mod export { let mut config = this.config.lock().unwrap(); api::matcher::add_matcher( &mut config, - &MatcherConfig { + MatcherConfig { name, match_severity, match_field, @@ -464,7 +464,7 @@ mod export { api::matcher::update_matcher( &mut config, name, - &MatcherConfigUpdater { + MatcherConfigUpdater { match_severity, match_field, match_calendar, -- 2.39.2