Skip to content

Commit ad26056

Browse files
Resolve some new warnings
1 parent 00ed130 commit ad26056

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/config/config.rs

+32
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,37 @@ pub struct ConfigNotify {
116116
#[serde(default = "defaults::notify_reminder_backoff_limit")]
117117
pub reminder_backoff_limit: u16,
118118

119+
#[cfg(feature = "notifier-email")]
119120
pub email: Option<ConfigNotifyEmail>,
121+
122+
#[cfg(feature = "notifier-twilio")]
120123
pub twilio: Option<ConfigNotifyTwilio>,
124+
125+
#[cfg(feature = "notifier-slack")]
121126
pub slack: Option<ConfigNotifySlack>,
127+
128+
#[cfg(feature = "notifier-zulip")]
122129
pub zulip: Option<ConfigNotifyZulip>,
130+
131+
#[cfg(feature = "notifier-telegram")]
123132
pub telegram: Option<ConfigNotifyTelegram>,
133+
134+
#[cfg(feature = "notifier-pushover")]
124135
pub pushover: Option<ConfigNotifyPushover>,
136+
137+
#[cfg(feature = "notifier-gotify")]
125138
pub gotify: Option<ConfigNotifyGotify>,
139+
140+
#[cfg(feature = "notifier-xmpp")]
126141
pub xmpp: Option<ConfigNotifyXMPP>,
142+
143+
#[cfg(feature = "notifier-matrix")]
127144
pub matrix: Option<ConfigNotifyMatrix>,
145+
146+
#[cfg(feature = "notifier-webex")]
128147
pub webex: Option<ConfigNotifyWebEx>,
148+
149+
#[cfg(feature = "notifier-webhook")]
129150
pub webhook: Option<ConfigNotifyWebHook>,
130151
}
131152

@@ -162,6 +183,7 @@ pub struct ConfigPluginsRabbitMQ {
162183
pub queue_loaded_retry_delay: Option<u64>,
163184
}
164185

186+
#[cfg(feature = "notifier-email")]
165187
#[derive(Deserialize)]
166188
pub struct ConfigNotifyEmail {
167189
pub to: String,
@@ -183,6 +205,7 @@ pub struct ConfigNotifyEmail {
183205
pub reminders_only: bool,
184206
}
185207

208+
#[cfg(feature = "notifier-twilio")]
186209
#[derive(Deserialize)]
187210
pub struct ConfigNotifyTwilio {
188211
pub to: Vec<String>,
@@ -194,6 +217,7 @@ pub struct ConfigNotifyTwilio {
194217
pub reminders_only: bool,
195218
}
196219

220+
#[cfg(feature = "notifier-slack")]
197221
#[derive(Deserialize)]
198222
pub struct ConfigNotifySlack {
199223
pub hook_url: SerdeUrl,
@@ -205,6 +229,7 @@ pub struct ConfigNotifySlack {
205229
pub reminders_only: bool,
206230
}
207231

232+
#[cfg(feature = "notifier-zulip")]
208233
#[derive(Deserialize)]
209234
pub struct ConfigNotifyZulip {
210235
pub bot_email: String,
@@ -216,6 +241,7 @@ pub struct ConfigNotifyZulip {
216241
pub reminders_only: bool,
217242
}
218243

244+
#[cfg(feature = "notifier-telegram")]
219245
#[derive(Deserialize)]
220246
pub struct ConfigNotifyTelegram {
221247
pub bot_token: String,
@@ -225,6 +251,7 @@ pub struct ConfigNotifyTelegram {
225251
pub reminders_only: bool,
226252
}
227253

254+
#[cfg(feature = "notifier-pushover")]
228255
#[derive(Deserialize)]
229256
pub struct ConfigNotifyPushover {
230257
pub app_token: String,
@@ -234,6 +261,7 @@ pub struct ConfigNotifyPushover {
234261
pub reminders_only: bool,
235262
}
236263

264+
#[cfg(feature = "notifier-gotify")]
237265
#[derive(Deserialize)]
238266
pub struct ConfigNotifyGotify {
239267
pub app_url: SerdeUrl,
@@ -243,6 +271,7 @@ pub struct ConfigNotifyGotify {
243271
pub reminders_only: bool,
244272
}
245273

274+
#[cfg(feature = "notifier-xmpp")]
246275
#[derive(Deserialize)]
247276
pub struct ConfigNotifyXMPP {
248277
pub to: String,
@@ -253,6 +282,7 @@ pub struct ConfigNotifyXMPP {
253282
pub reminders_only: bool,
254283
}
255284

285+
#[cfg(feature = "notifier-matrix")]
256286
#[derive(Deserialize)]
257287
pub struct ConfigNotifyMatrix {
258288
pub homeserver_url: SerdeUrl,
@@ -263,6 +293,7 @@ pub struct ConfigNotifyMatrix {
263293
pub reminders_only: bool,
264294
}
265295

296+
#[cfg(feature = "notifier-webex")]
266297
#[derive(Deserialize)]
267298
pub struct ConfigNotifyWebEx {
268299
pub endpoint_url: SerdeUrl,
@@ -273,6 +304,7 @@ pub struct ConfigNotifyWebEx {
273304
pub reminders_only: bool,
274305
}
275306

307+
#[cfg(feature = "notifier-webhook")]
276308
#[derive(Deserialize)]
277309
pub struct ConfigNotifyWebHook {
278310
pub hook_url: SerdeUrl,

src/config/defaults.rs

+4
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,22 @@ pub fn notify_reminder_backoff_limit() -> u16 {
9393
3
9494
}
9595

96+
#[cfg(feature = "notifier-email")]
9697
pub fn notify_email_smtp_host() -> String {
9798
"localhost".to_string()
9899
}
99100

101+
#[cfg(feature = "notifier-email")]
100102
pub fn notify_email_smtp_port() -> u16 {
101103
587
102104
}
103105

106+
#[cfg(feature = "notifier-email")]
104107
pub fn notify_email_smtp_encrypt() -> bool {
105108
true
106109
}
107110

111+
#[cfg(feature = "notifier-slack")]
108112
pub fn notify_slack_mention_channel() -> bool {
109113
false
110114
}

0 commit comments

Comments
 (0)