curl implementation

This commit is contained in:
2025-01-16 13:26:07 +01:00
parent 6ca98da28b
commit c42d550acf
4 changed files with 61 additions and 9 deletions

View File

@@ -31,7 +31,7 @@ pub fn get_json(path: &Path) -> HashMap<String, String> {
fn read_file(path: &Path) -> String {
let read_result = File::open(path);
let mut result= String::new();
let mut result = String::new();
match read_result {
Ok(mut t) => {
@@ -45,7 +45,7 @@ fn read_file(path: &Path) -> String {
},
Err(err) => match err.kind() {
ErrorKind::NotFound => {
println!("[ERROR] The file '{}' does not exist", path.display());
eprintln!("[ERROR] The file '{}' does not exist", path.display());
exit(1);
},
_ => panic!("[ERROR] Unexpected error, closing ..."),