mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-19 17:17:02 +00:00
notify: fix build warnings if not all features are enabled
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
1e095e5ab8
commit
f6fa851d1f
@ -87,7 +87,8 @@ fn verify_digest(config: &Config, digest: Option<&[u8]>) -> Result<(), ApiError>
|
|||||||
Ok(())
|
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;
|
let mut exists = false;
|
||||||
|
|
||||||
#[cfg(feature = "sendmail")]
|
#[cfg(feature = "sendmail")]
|
||||||
|
@ -57,6 +57,7 @@ fn config_init() -> SectionConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn private_config_init() -> SectionConfig {
|
fn private_config_init() -> SectionConfig {
|
||||||
|
#[allow(unused_mut)]
|
||||||
let mut config = SectionConfig::new(&BACKEND_NAME_SCHEMA);
|
let mut config = SectionConfig::new(&BACKEND_NAME_SCHEMA);
|
||||||
|
|
||||||
#[cfg(feature = "gotify")]
|
#[cfg(feature = "gotify")]
|
||||||
|
@ -14,6 +14,7 @@ pub fn set_context(context: &'static dyn Context) {
|
|||||||
CONTEXT.set(context).expect("context has already been set");
|
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 {
|
pub(crate) fn context() -> &'static dyn Context {
|
||||||
*CONTEXT.get().expect("context has not been yet")
|
*CONTEXT.get().expect("context has not been yet")
|
||||||
}
|
}
|
||||||
|
@ -226,6 +226,7 @@ macro_rules! parse_endpoints_without_private_config {
|
|||||||
impl Bus {
|
impl Bus {
|
||||||
/// Instantiate notification bus from a given configuration.
|
/// Instantiate notification bus from a given configuration.
|
||||||
pub fn from_config(config: &Config) -> Result<Self, Error> {
|
pub fn from_config(config: &Config) -> Result<Self, Error> {
|
||||||
|
#[allow(unused_mut)]
|
||||||
let mut endpoints = HashMap::new();
|
let mut endpoints = HashMap::new();
|
||||||
|
|
||||||
// Instantiate endpoints
|
// Instantiate endpoints
|
||||||
|
Loading…
Reference in New Issue
Block a user