Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions rust/sbp/src/sbp_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ impl SbpString<Vec<u8>, DoubleNullTerminated> {
data: impl Into<Vec<u8>>,
) -> Result<Self, DoubleNullTerminatedError> {
let vec = data.into();
if let [.., two, one] = vec.as_slice()
&& two == &0
&& one == &0
{
return Ok(SbpString::new(vec));
if let [.., &two, &one] = vec.as_slice() {
if two = 0 && one == 0 {
return Ok(SbpString::new(vec));
}
};
Err(DoubleNullTerminatedError)
}
Expand Down
Loading