Skip to content

Commit

Permalink
refactor(rumqttd): avoid using unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
arunanshub committed Apr 2, 2024
1 parent dc6b105 commit b4fe7f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rumqttd/src/protocol/mod.rs
Expand Up @@ -647,7 +647,9 @@ pub fn valid_filter(filter: impl AsRef<str>) -> bool {
// split will never return an empty iterator
// even if the pattern isn't matched, the original string will be there
// so it is safe to just unwrap here!
let last = hirerarchy.next().unwrap();
let Some(last) = hirerarchy.next() else {
return false;
};

// only single '#" or '+' is allowed in last entry
// invalid: sport/tennis#
Expand Down

0 comments on commit b4fe7f5

Please sign in to comment.