From f6477359e900beaf1e680d81d46e1c01ede1851a Mon Sep 17 00:00:00 2001 From: Yuhki Date: Sat, 24 May 2025 03:00:33 +0200 Subject: [PATCH] Fix unused import warnings for windows --- src/io/util.rs | 6 +++++- src/main.rs | 6 ++++-- src/network/client.rs | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/io/util.rs b/src/io/util.rs index fafaaa1..dcd5411 100644 --- a/src/io/util.rs +++ b/src/io/util.rs @@ -2,8 +2,12 @@ use colored::Colorize; use reqwest::blocking::Client; use serde_json::Value; use std::{ - fs::{self, File}, io::{self, Write}, process::Command, sync::Arc, thread, time::{Duration, Instant} + fs::{self, File}, io::{self, Write}, sync::Arc, thread, time::{Duration, Instant} }; + +#[cfg(not(target_os = "windows"))] +use std::process::Command; + #[cfg(windows)] use winconsole::console::{clear, set_title}; diff --git a/src/main.rs b/src/main.rs index 4f03f3e..659216e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,10 @@ -use std::process::Command; - use colored::*; use reqwest::blocking::Client; use serde_json::Value; + +#[cfg(not(target_os = "windows"))] +use std::process::Command; + #[cfg(windows)] use winconsole::console::{clear, set_title}; diff --git a/src/network/client.rs b/src/network/client.rs index 680afa8..460886e 100644 --- a/src/network/client.rs +++ b/src/network/client.rs @@ -4,8 +4,11 @@ use indicatif::{ProgressBar, ProgressStyle}; use reqwest::blocking::Client; use serde_json::{Value, from_reader, from_str}; use std::{ - fs, io::{self, Read, Write}, path::Path, process::Command, time::Duration, u64 + fs, io::{self, Read, Write}, path::Path, time::Duration, u64 }; +#[cfg(not(target_os = "windows"))] +use std::process::Command; + #[cfg(windows)] use winconsole::console::clear;