Fix clippy warnings for detect-targets and binstalk-downloader

binstalk-downloader clippy warning is specific to windows

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2025-03-20 01:07:38 +11:00
parent ce998d1af4
commit cf06055e0c
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928
2 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,6 @@
use std::{
fs::{self, create_dir_all, File},
io::{self, Read},
fs::{create_dir_all, File},
io,
path::Path,
};
@ -38,6 +38,8 @@ pub(super) fn do_extract_zip(f: File, dir: &Path) -> Result<ExtractedFiles, Down
if #[cfg(windows)] {
do_extract_file()?;
} else {
use std::{fs, io::Read};
match fs::symlink_metadata(&path) {
Ok(metadata) if metadata.is_file() => fs::remove_file(&path)?,
_ => (),

View file

@ -8,7 +8,7 @@ use tokio::{process::Command, task};
use tracing::debug;
pub(super) async fn detect_targets(target: String) -> Vec<String> {
let (prefix, postfix) = target
let (_, postfix) = target
.rsplit_once('-')
.expect("unwrap: target always has a -");