diff --git a/commons/zenoh-protocol/src/core/mod.rs b/commons/zenoh-protocol/src/core/mod.rs index 2ee15a07ab..efb294d415 100644 --- a/commons/zenoh-protocol/src/core/mod.rs +++ b/commons/zenoh-protocol/src/core/mod.rs @@ -310,7 +310,6 @@ pub enum Priority { Background = 7, } -// TODO: Use Priority type #[derive(Debug, Clone, Eq, Hash, PartialEq, Serialize)] /// A `u8` range bounded inclusively below and above. pub struct PriorityRange(RangeInclusive); @@ -334,7 +333,11 @@ impl PriorityRange { } pub fn len(&self) -> usize { - *self.end() as usize - *self.start() as usize + 1 // 1..=3, 3-1 == 2 + *self.end() as usize - *self.start() as usize + 1 + } + + pub fn is_empty(&self) -> bool { + false } #[cfg(feature = "test")]