From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5A91A1FF38F for ; Tue, 21 May 2024 15:32:32 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10A3D19EA6; Tue, 21 May 2024 15:32:27 +0200 (CEST) From: Lukas Wagner To: pve-devel@lists.proxmox.com Date: Tue, 21 May 2024 15:31:42 +0200 Message-Id: <20240521133148.223266-3-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240521133148.223266-1-l.wagner@proxmox.com> References: <20240521133148.223266-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.003 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 v3 2/8] 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" proxmox_notify's api functions have been changed so that they take ownership of config structs. Signed-off-by: Lukas Wagner --- 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 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel