Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed Feb 26, 2024
1 parent 6175677 commit 8ca1a34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commons/zenoh-keyexpr/src/key_expr/borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ impl<'a> Iterator for SplitsLeftToRight<'a> {
if left.is_empty() {
self.next()
} else {
// SAFETY: because any keyexpr split at `/` becomes 2 valid keyexprs by design, it's safe to assume the constraint is valid once both sides have been validated to not be empty.
(!right.is_empty()).then(|| unsafe {
(
keyexpr::from_str_unchecked(left),
Expand Down Expand Up @@ -401,6 +402,7 @@ impl<'a> Iterator for SplitsRightToLeft<'a> {
if right.is_empty() {
self.next()
} else {
// SAFETY: because any keyexpr split at `/` becomes 2 valid keyexprs by design, it's safe to assume the constraint is valid once both sides have been validated to not be empty.
(!left.is_empty()).then(|| unsafe {
(
keyexpr::from_str_unchecked(left),
Expand Down

0 comments on commit 8ca1a34

Please sign in to comment.