Skip to content

Commit

Permalink
Fix clippy warnings (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 authored Nov 16, 2024
1 parent 6302080 commit 2dd7af4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/macro/internal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ fn get_usize(map: &mut HashMap<String, TokenTree>, key: &str) -> usize {
}

fn get_padding(map: &mut HashMap<String, TokenTree>) -> Option<char> {
let node = match map.remove("padding") {
None => return None,
Some(node) => node,
};
let node = map.remove("padding")?;
if let Ok(result) = syn::parse::<syn::LitChar>(node.clone().into()) {
return Some(result.value());
}
Expand All @@ -81,10 +78,7 @@ fn get_padding(map: &mut HashMap<String, TokenTree>) -> Option<char> {
}

fn get_bool(map: &mut HashMap<String, TokenTree>, key: &str) -> Option<bool> {
let node = match map.remove(key) {
None => return None,
Some(node) => node,
};
let node = map.remove(key)?;
match syn::parse::<syn::LitBool>(node.into()) {
Ok(result) => Some(result.value),
_ => panic!("expected bool for {}", key),
Expand Down

0 comments on commit 2dd7af4

Please sign in to comment.