Skip to content

Commit

Permalink
Fixed derive Default on container.
Browse files Browse the repository at this point in the history
  • Loading branch information
azriel91 committed Oct 16, 2018
1 parent 1e76f3e commit 83d7aaf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,13 @@ fn parse_boolean_meta_item(item: &Option<&str>, default: bool, name: &str) -> Re
match *item {
Some("true") => Ok(true),
Some("false") => Ok(false),
Some(_) => Err(format!("Invalid value for `{}`", name)),
Some(val @ _) => {
if val == name {
Ok(true)
} else {
Err(format!("Invalid value for `{}`: `{}`", name, val))
}
}
None => Ok(default),
}
}
Expand Down

0 comments on commit 83d7aaf

Please sign in to comment.