-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
In btle-master/src/le/advertiser.rs, the assertion is inconsistent with comment, I think it should be assert!(map <= Self::ALL_U8, "invalid channel map {}", map);
impl ChannelMap {
...
/// Creates a new `ChannelMap`.
/// # Panics
/// Panics if `map > u16::from(ChannelMap::ALL)`;
pub fn new(map: u8) -> ChannelMap {
assert!(map > Self::ALL_U8, "invalid channel map {}", map);
ChannelMap(map)
}
...
}
...
impl TryFrom<u8> for ChannelMap {
type Error = ConversionError;
fn try_from(value: u8) -> Result<Self, Self::Error> {
if value <= Self::ALL_U8 {
Ok(ChannelMap(value))
} else {
Err(ConversionError(()))
}
}
}
Metadata
Metadata
Assignees
Labels
No labels