diff --git a/rust/sbp/Cargo.toml b/rust/sbp/Cargo.toml index 29519bc316..7b73601bb7 100644 --- a/rust/sbp/Cargo.toml +++ b/rust/sbp/Cargo.toml @@ -55,7 +55,7 @@ version = "0.4" optional = true [dependencies.base64] -version = "0.13" +version = "0.22" optional = true [dependencies.futures] diff --git a/rust/sbp/src/sbp_string.rs b/rust/sbp/src/sbp_string.rs index a80e61f9f8..0256b46ab7 100644 --- a/rust/sbp/src/sbp_string.rs +++ b/rust/sbp/src/sbp_string.rs @@ -101,11 +101,10 @@ impl SbpString, DoubleNullTerminated> { data: impl Into>, ) -> Result { 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) }