rust/clippy: fix lint: while_let_loop

pull/8251/head
Jason Ish 3 years ago committed by Victor Julien
parent 4daee8bae1
commit 925bc74c1f

@ -50,7 +50,6 @@
#![allow(clippy::single_match)]
#![allow(clippy::type_complexity)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::while_let_loop)]
#[macro_use]
extern crate bitflags;

@ -28,16 +28,11 @@ use widestring::U16CString;
pub fn le_slice_to_string(input: &[u8]) -> Result<String, Box<dyn std::error::Error>> {
let mut vec = Vec::new();
let mut cursor = Cursor::new(input);
loop {
match cursor.read_u16::<byteorder::LittleEndian>() {
Ok(x) => {
if x == 0 {
break;
};
vec.push(x)
}
Err(_) => break,
while let Ok(x) = cursor.read_u16::<byteorder::LittleEndian>() {
if x == 0 {
break;
}
vec.push(x);
}
match U16CString::new(vec) {
Ok(x) => match x.to_string() {

Loading…
Cancel
Save