@@ -302,25 +302,18 @@ pub fn cat(file: &str) -> Result<(usize,String),Error>{
302
302
return Ok ( empty_file ( ) ) ;
303
303
}
304
304
let mut buffer = String :: new ( ) ;
305
- let file_size = max_size_file ( file) ;
306
- match file_size{
307
- Ok ( _) =>{
308
- let f = fs:: File :: open ( Path :: new ( file) ) ;
309
- let _ = f. unwrap ( ) . read_to_string ( & mut buffer) ;
310
- } ,
311
- Err ( err) =>{
312
- return Ok ( ( ERR_CODE , err. to_string ( ) ) ) ;
313
- }
314
- }
305
+ let f = fs:: File :: open ( Path :: new ( file) ) ;
306
+ let _ = f. unwrap ( ) . read_to_string ( & mut buffer) ;
307
+
315
308
Ok ( ( STATUE_CODE , buffer) )
316
309
}
317
310
318
311
319
312
use crate :: commands:: download:: { download_package, find_package} ;
320
313
use crate :: priority:: get_priority;
321
- use crate :: set:: set:: { file_create_time, max_size_file } ;
314
+ use crate :: set:: set:: file_create_time;
322
315
use crate :: run:: run;
323
- use crate :: state_code:: { empty_dir, empty_file, missing_pattern, ERR_CODE , STATUE_CODE } ;
316
+ use crate :: state_code:: { empty_dir, empty_file, missing_pattern, STATUE_CODE } ;
324
317
use super :: download:: update;
325
318
use crate :: root:: SessionContext ;
326
319
@@ -551,7 +544,6 @@ pub fn priority_run(command:Vec<String>,session_context: &mut SessionContext){
551
544
}
552
545
553
546
save_command. sort_by_key ( |c| -( get_priority ( & c[ 0 ] ) . as_number ( ) as i32 ) ) ;
554
- println ! ( "{:?}" , save_command) ;
555
547
556
548
for c in save_command{
557
549
run ( c, session_context)
0 commit comments