@@ -58,10 +58,10 @@ enum Commands {
5858
5959 /// Display OS-specific scheduling instructions
6060 ScheduleUpdates {
61- ///Time between updates
62- #[ arg( short, long, default_value_t = 24 ) ]
63- hours : u64
64- } ,
61+ ///Time between updates
62+ #[ arg( short, long, default_value_t = 24 ) ]
63+ hours : u64 ,
64+ } ,
6565
6666 /// Remove a quarantined malware file
6767 Remove {
@@ -80,7 +80,7 @@ enum Commands {
8080 #[ arg( short, long, value_hint = clap:: ValueHint :: AnyPath ) ]
8181 path : PathBuf ,
8282 ///Malware name
83- #[ arg( short= 'n' , long) ]
83+ #[ arg( short = 'n' , long) ]
8484 name : Option < String > ,
8585 } ,
8686
@@ -100,11 +100,11 @@ enum Commands {
100100 #[ arg( short, long, value_hint = clap:: ValueHint :: AnyPath ) ]
101101 path : PathBuf ,
102102
103- /// Skip file removal confirmation
103+ /// Skip file removal confirmation
104104 #[ arg( short, long) ]
105105 force : bool ,
106106 } ,
107- ///Hash a file
107+ ///Hash a file
108108 Hash {
109109 /// Path to file or directory
110110 #[ arg( short, long) ]
@@ -119,14 +119,14 @@ fn main() -> ExitCode {
119119 // Handle command errors
120120 if let Err ( err) = run ( ) {
121121 error ! ( "Error: {err}" ) ;
122- return ExitCode :: FAILURE ;
122+ ExitCode :: FAILURE
123123 } else {
124- ExitCode :: SUCCESS }
124+ ExitCode :: SUCCESS
125+ }
125126}
126127
127-
128128fn run ( ) -> Result < ( ) , anyhow:: Error > {
129- // Parse command line arguments
129+ // Parse command line arguments
130130 let cli = Cli :: parse ( ) ;
131131
132132 // Initialize logger with appropriate verbosity
@@ -135,7 +135,7 @@ fn run() -> Result<(), anyhow::Error> {
135135 } ) ;
136136
137137 // Execute the selected command
138- let result = match cli. command {
138+ match cli. command {
139139 Commands :: Scan { path, deep } => {
140140 info ! ( "Scanning path: {}, deep scan: {}" , path. display( ) , deep) ;
141141 cli:: scan:: handle_scan_command ( path, deep)
@@ -152,7 +152,7 @@ fn run() -> Result<(), anyhow::Error> {
152152 info ! ( "Removing malware with ID: {id}" ) ;
153153 cli:: remove:: handle_remove_command ( & id, force)
154154 }
155- Commands :: ScheduleUpdates { hours} => cli:: update:: handle_schedule_command ( hours) ,
155+ Commands :: ScheduleUpdates { hours } => cli:: update:: handle_schedule_command ( hours) ,
156156 Commands :: QuarantineFile { path, name } => {
157157 info ! ( "Quarantining malware with Path: {}" , path. display( ) ) ;
158158 cli:: quarantine:: handle_quarantine_file_command ( path, name)
@@ -162,11 +162,12 @@ fn run() -> Result<(), anyhow::Error> {
162162 cli:: quarantine:: handle_list_quarantine_command ( )
163163 }
164164 Commands :: Restore { id } => cli:: quarantine:: handle_restore_command ( & id) ,
165- Commands :: RemoveFile { path, force } => cli:: remove:: handle_remove_file_command ( path, force) ,
165+ Commands :: RemoveFile { path, force } => {
166+ cli:: remove:: handle_remove_file_command ( path, force)
167+ }
166168 Commands :: Hash { path, json } => {
167169 info ! ( "Hashing file with name {path}" ) ;
168170 cli:: hash:: handle_hash_command ( & path, json)
169171 }
170- } ;
171- return result;
172+ }
172173}
0 commit comments