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
|
|
@ -121,7 +121,8 @@ impl SplitPacket {
|
|||
|
||||
let decompressed_size = self.decompressed_size.unwrap() as usize;
|
||||
|
||||
let mut decompressed_payload = Vec::with_capacity(decompressed_size);
|
||||
let mut decompressed_payload = vec![0; decompressed_size];
|
||||
|
||||
decoder.read(&mut decompressed_payload).map_err(|_| Decompress)?;
|
||||
|
||||
if decompressed_payload.len() != decompressed_size
|
||||
|
|
|
|||
|
|
@ -116,10 +116,20 @@ pub struct ModData {
|
|||
pub has_own_dll: bool
|
||||
}
|
||||
|
||||
pub(crate) fn get_optional_extracted_data(data: Option<ExtraData>) -> (Option<u16>, Option<u64>, Option<u16>, Option<String>, Option<String>) {
|
||||
pub(crate) type ExtractedData = (
|
||||
Option<u16>,
|
||||
Option<u64>,
|
||||
Option<u16>,
|
||||
Option<String>,
|
||||
Option<String>,
|
||||
);
|
||||
|
||||
pub(crate) fn get_optional_extracted_data(
|
||||
data: Option<ExtraData>,
|
||||
) -> ExtractedData {
|
||||
match data {
|
||||
None => (None, None, None, None, None),
|
||||
Some(ed) => (ed.port, ed.steam_id, ed.tv_port, ed.tv_name, ed.keywords)
|
||||
Some(ed) => (ed.port, ed.steam_id, ed.tv_port, ed.tv_name, ed.keywords),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue