Skip to content

Commit

Permalink
Merge #549
Browse files Browse the repository at this point in the history
549: `parser`: Satisfy clippy r=Urhengulas a=Urhengulas

bors r+

Co-authored-by: Johann Hemmann <[email protected]>
  • Loading branch information
bors[bot] and Urhengulas authored Jul 22, 2021
2 parents 68a7349 + dbb207e commit 99f8de5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,8 @@ fn parse_display_hint(mut s: &str) -> Option<DisplayHint> {
0 // default behavior is the same as no zero-padding.
};

if s.starts_with(BITFLAGS_HINT_START) {
let parts = s[BITFLAGS_HINT_START.len()..]
.split('@')
.collect::<Vec<_>>();
if let Some(stripped) = s.strip_prefix(BITFLAGS_HINT_START) {
let parts = stripped.split('@').collect::<Vec<_>>();
match *parts {
[bitflags_name, package, disambiguator] => {
return Some(DisplayHint::Bitflags {
Expand Down

0 comments on commit 99f8de5

Please sign in to comment.