Skip to content

Commit

Permalink
Remove unused define_conf-macro definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed May 29, 2018
1 parent ce229b2 commit 3a41e01
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions clippy_lints/src/utils/conf.rs
Expand Up @@ -113,29 +113,6 @@ macro_rules! define_Conf {
// hack to convert tts
(TY $ty: ty) => { $ty };

// how to read the value?
(CONV i64, $value: expr) => { $value.as_integer() };
(CONV u64, $value: expr) => {
$value.as_integer()
.iter()
.filter_map(|&i| if i >= 0 { Some(i as u64) } else { None })
.next()
};
(CONV String, $value: expr) => { $value.as_str().map(Into::into) };
(CONV Vec<String>, $value: expr) => {{
let slice = $value.as_array();

if let Some(slice) = slice {
if slice.iter().any(|v| v.as_str().is_none()) {
None
} else {
Some(slice.iter().map(|v| v.as_str().expect("already checked").to_owned()).collect())
}
} else {
None
}
}};

// provide a nicer syntax to declare the default value of `Vec<String>` variables
(DEFAULT Vec<String>, $e: expr) => { $e.iter().map(|&e| e.to_owned()).collect() };
(DEFAULT $ty: ty, $e: expr) => { $e };
Expand Down

0 comments on commit 3a41e01

Please sign in to comment.