1- use file_classification_core:: create_file;
2- use file_classification_core:: establish_connection;
1+ use file_classification_core:: files :: create_file;
2+ use file_classification_core:: database :: establish_connection;
33use std:: io:: stdin;
44
55fn main ( ) {
@@ -10,22 +10,22 @@ fn main() {
1010 let mut path = String :: new ( ) ;
1111
1212 println ! ( "Please input File Name:" ) ;
13- stdin ( ) . read_line ( & mut type_) . unwrap ( ) ;
14- let type_ = type_. trim_end ( ) ;
15-
16- println ! ( "Please input File Type:" ) ;
1713 stdin ( ) . read_line ( & mut name) . unwrap ( ) ;
1814 let name = name. trim_end ( ) ;
1915
16+ println ! ( "Please input File Type:" ) ;
17+ stdin ( ) . read_line ( & mut type_) . unwrap ( ) ;
18+ let type_ = type_. trim_end ( ) ;
19+
2020 println ! ( "Please input File Path:" ) ;
2121 stdin ( ) . read_line ( & mut path) . unwrap ( ) ;
2222 let path = path. trim_end ( ) ;
2323
24- let result = create_file ( connection, name, path , & type_ ) ;
24+ let result = create_file ( connection, name, type_ , path ) ;
2525 match result {
2626 Ok ( ( file, group) ) => {
27- println ! ( "\n Saved file {path} with id {} " , file. id ) ;
28- println ! ( "Saved group {type_} with id {} " , group. id ) ;
27+ println ! ( "File created successfully!(File<{:?}>) " , file) ;
28+ println ! ( "Group created successfully!(Group<{:?}>) " , group) ;
2929 }
3030 Err ( e) => {
3131 eprintln ! ( "An error occurred: {}" , e) ;
0 commit comments