public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox 1/2] notify: fix build warnings if not all features are enabled
Date: Mon, 24 Jul 2023 14:31:24 +0200	[thread overview]
Message-ID: <20230724123125.641268-1-l.wagner@proxmox.com> (raw)

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-notify/src/api/mod.rs | 3 ++-
 proxmox-notify/src/config.rs  | 1 +
 proxmox-notify/src/context.rs | 1 +
 proxmox-notify/src/lib.rs     | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/proxmox-notify/src/api/mod.rs b/proxmox-notify/src/api/mod.rs
index 9a59719b..a4e0e40f 100644
--- a/proxmox-notify/src/api/mod.rs
+++ b/proxmox-notify/src/api/mod.rs
@@ -87,7 +87,8 @@ fn verify_digest(config: &Config, digest: Option<&[u8]>) -> Result<(), ApiError>
     Ok(())
 }
 
-fn ensure_endpoint_exists(config: &Config, name: &str) -> Result<(), ApiError> {
+fn ensure_endpoint_exists(#[allow(unused)] config: &Config, name: &str) -> Result<(), ApiError> {
+    #[allow(unused_mut)]
     let mut exists = false;
 
     #[cfg(feature = "sendmail")]
diff --git a/proxmox-notify/src/config.rs b/proxmox-notify/src/config.rs
index 645b7bf6..a5964007 100644
--- a/proxmox-notify/src/config.rs
+++ b/proxmox-notify/src/config.rs
@@ -57,6 +57,7 @@ fn config_init() -> SectionConfig {
 }
 
 fn private_config_init() -> SectionConfig {
+    #[allow(unused_mut)]
     let mut config = SectionConfig::new(&BACKEND_NAME_SCHEMA);
 
     #[cfg(feature = "gotify")]
diff --git a/proxmox-notify/src/context.rs b/proxmox-notify/src/context.rs
index 72e07d5b..b7b6a580 100644
--- a/proxmox-notify/src/context.rs
+++ b/proxmox-notify/src/context.rs
@@ -14,6 +14,7 @@ pub fn set_context(context: &'static dyn Context) {
     CONTEXT.set(context).expect("context has already been set");
 }
 
+#[allow(unused)] // context is not used if all endpoint features are disabled
 pub(crate) fn context() -> &'static dyn Context {
     *CONTEXT.get().expect("context has not been yet")
 }
diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs
index 6a52db06..e8cd6b08 100644
--- a/proxmox-notify/src/lib.rs
+++ b/proxmox-notify/src/lib.rs
@@ -226,6 +226,7 @@ macro_rules! parse_endpoints_without_private_config {
 impl Bus {
     /// Instantiate notification bus from a given configuration.
     pub fn from_config(config: &Config) -> Result<Self, Error> {
+        #[allow(unused_mut)]
         let mut endpoints = HashMap::new();
 
         // Instantiate endpoints
-- 
2.39.2





             reply	other threads:[~2023-07-24 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 12:31 Lukas Wagner [this message]
2023-07-24 12:31 ` [pve-devel] [PATCH proxmox 2/2] notify: fix tests " Lukas Wagner
2023-07-28  8:45 ` [pve-devel] applied-series: [PATCH proxmox 1/2] notify: fix build warnings " Wolfgang Bumiller

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=20230724123125.641268-1-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pve-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal