From 7776220e0649f9d1f8d5b82d554c84825a8ead44 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Fri, 22 Mar 2024 21:13:30 +0000 Subject: [PATCH] cargo: fmt --- src/main.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2274838..58e90e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ -use std::{fs, path, process}; use clap::Parser; use colored::Colorize; +use std::{fs, path, process}; #[derive(Parser, Debug)] #[command(version, about, long_about = None, author)] @@ -19,7 +19,10 @@ fn main() -> std::io::Result<()> { if args.targets.is_empty() { println!("{} no arguments passed", "error:".red().bold()); - println!("{} try 'vpr -h' for more information", "note:".cyan().bold()); + println!( + "{} try 'vpr -h' for more information", + "note:".cyan().bold() + ); process::exit(0); } @@ -28,7 +31,7 @@ fn main() -> std::io::Result<()> { println!("{} you're trying to delete an important directory ({})! specify '{}' if you really want to do this", "error:".red().bold(), "--no-preserve".yellow(), target); process::exit(0); } - + if path::Path::new(target).exists() { if fs::metadata(target).unwrap().is_dir() { let _ = fs::remove_dir_all(target); @@ -36,7 +39,11 @@ fn main() -> std::io::Result<()> { let _ = fs::remove_file(target); } } else { - println!("{} the specified target does not exist {}", "error:".red().bold(), target.yellow()); + println!( + "{} the specified target does not exist {}", + "error:".red().bold(), + target.yellow() + ); } }