Commit 50a972db6f

50a972db6f0700fe3b96f8e6b07223ef7fb829f7

parent: c4d1d79629

Unsigned

Damir Jelić <poljar@termina.org.uk> · 2020-07-01 15:47 UTC

config_macros: Disable some warnings.

Layout: unified · split

src/config_macros.rs +3
@@ -38,6 +38,7 @@ macro_rules! option_create {
38macro_rules! option_getter { 38macro_rules! option_getter {
39 ($option_type:ident, $option_name:ident, $output_type:ty) => { 39 ($option_type:ident, $option_name:ident, $output_type:ty) => {
40 paste::item! { 40 paste::item! {
41 #[allow(dead_code)]
41 pub fn [<$option_name>](&self) -> $output_type { 42 pub fn [<$option_name>](&self) -> $output_type {
42 let option_name = stringify!($option_name); 43 let option_name = stringify!($option_name);
43 44
@@ -251,6 +252,7 @@ macro_rules! config {
251 #[allow(unused_imports)] 252 #[allow(unused_imports)]
252 use strum::VariantNames; 253 use strum::VariantNames;
253 use std::ops::{Deref, DerefMut}; 254 use std::ops::{Deref, DerefMut};
255 #[allow(unused_imports)]
254 use weechat::config::{ 256 use weechat::config::{
255 SectionHandle, SectionHandleMut, StringOptionSettings, 257 SectionHandle, SectionHandleMut, StringOptionSettings,
256 ConfigOption, ConfigSection, ConfigSectionSettings, 258 ConfigOption, ConfigSection, ConfigSectionSettings,
@@ -292,6 +294,7 @@ macro_rules! config {
292 294
293 paste::item! { 295 paste::item! {
294 $( 296 $(
297 #[allow(dead_code)]
295 pub fn $section(&self) -> [<$section:camel Section>] { 298 pub fn $section(&self) -> [<$section:camel Section>] {
296 let section_name = stringify!($section); 299 let section_name = stringify!($section);
297 let section = self.0.search_section(section_name) 300 let section = self.0.search_section(section_name)