chore: fix linting issues caused to update of rust/clippy to newer version

This commit is contained in:
Michel de Graaf
2025-11-07 10:29:55 +01:00
parent 5e54fa1f94
commit bbfccbccfe
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -83,7 +83,10 @@ impl FileManager {
} }
fn extract_filename_from_path(full_path: &str) -> &str { fn extract_filename_from_path(full_path: &str) -> &str {
full_path.split(['/', '\\']).last().unwrap_or(full_path) full_path
.split(['/', '\\'])
.next_back()
.unwrap_or(full_path)
} }
fn create_download_path_from_filename( fn create_download_path_from_filename(
+1 -1
View File
@@ -72,7 +72,7 @@ pub fn deflate(input: &[u8]) -> Result<Vec<u8>> {
return Err(SoulseekRs::CompressionError("invalid CINFO".to_string())); return Err(SoulseekRs::CompressionError("invalid CINFO".to_string()));
} }
let flg = r.read_byte()?; let flg = r.read_byte()?;
if ((cmf as u32) * 256 + (flg as u32)) % 31 != 0 { if !((cmf as u32) * 256 + (flg as u32)).is_multiple_of(31) {
return Err(SoulseekRs::CompressionError( return Err(SoulseekRs::CompressionError(
"CMF+FLG checksum failed".to_string(), "CMF+FLG checksum failed".to_string(),
)); ));