mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 21:48:42 +00:00
Fix clippy warnings for detect-targets and binstalk-downloader (#2098)
binstalk-downloader clippy warning is specific to windows Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
bb0d6c1f9c
commit
028b24de4d
2 changed files with 5 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
use std::{
|
use std::{
|
||||||
fs::{self, create_dir_all, File},
|
fs::{create_dir_all, File},
|
||||||
io::{self, Read},
|
io,
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@ pub(super) fn do_extract_zip(f: File, dir: &Path) -> Result<ExtractedFiles, Down
|
||||||
if #[cfg(windows)] {
|
if #[cfg(windows)] {
|
||||||
do_extract_file()?;
|
do_extract_file()?;
|
||||||
} else {
|
} else {
|
||||||
|
use std::{fs, io::Read};
|
||||||
|
|
||||||
match fs::symlink_metadata(&path) {
|
match fs::symlink_metadata(&path) {
|
||||||
Ok(metadata) if metadata.is_file() => fs::remove_file(&path)?,
|
Ok(metadata) if metadata.is_file() => fs::remove_file(&path)?,
|
||||||
_ => (),
|
_ => (),
|
||||||
|
|
|
@ -8,7 +8,7 @@ use tokio::{process::Command, task};
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
pub(super) async fn detect_targets(target: String) -> Vec<String> {
|
pub(super) async fn detect_targets(target: String) -> Vec<String> {
|
||||||
let (prefix, postfix) = target
|
let (_, postfix) = target
|
||||||
.rsplit_once('-')
|
.rsplit_once('-')
|
||||||
.expect("unwrap: target always has a -");
|
.expect("unwrap: target always has a -");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue