mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
[Crate] Make clippy happy (#23)
* fix: clippy::type_complexity * fix: clippy::needless_doctest_main * fix: clippy::read_zero_byte_vec * fix: clippy::useless_conversion * fix: clippy::slow_vector_initialization
This commit is contained in:
parent
7f73eb582d
commit
bd2e373d66
4 changed files with 31 additions and 21 deletions
|
|
@ -125,11 +125,13 @@ impl Bufferer {
|
|||
return Err(PacketUnderflow);
|
||||
}
|
||||
|
||||
let paired_buf: Vec<u16> = sub_buf.chunks_exact(2)
|
||||
.into_iter().map(|pair| match self.endianess {
|
||||
Endianess::Little => LittleEndian::read_u16(pair),
|
||||
Endianess::Big => BigEndian::read_u16(pair)
|
||||
}).collect();
|
||||
let paired_buf: Vec<u16> = sub_buf
|
||||
.chunks_exact(2)
|
||||
.map(|pair| match self.endianess {
|
||||
Endianess::Little => LittleEndian::read_u16(pair),
|
||||
Endianess::Big => BigEndian::read_u16(pair),
|
||||
})
|
||||
.collect();
|
||||
|
||||
let value = String::from_utf16(&paired_buf).map_err(|_| PacketBad)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue