Skip to content

Commit f301fc5

Browse files
committed
fixed 'add' mod
1 parent eeb1120 commit f301fc5

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/database/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub mod add
5252
const storagePATH : &str = "rustix/storage.txt";
5353

5454

55-
fn write_file(save_info: [String; 4]) -> std::io::Result<()>
55+
fn write_file(save_info: [String; 4]) -> bool
5656
{
5757
let SAVES_BASE = crate::database::get::start().unwrap();
5858
let mut UNIQUE_SAVE : bool = true;
@@ -67,17 +67,11 @@ pub mod add
6767
println!("Added !");
6868
} else { println!("Such a name already exists !"); }
6969

70-
Ok(())
70+
return UNIQUE_SAVE;
7171
}
7272

7373

7474
// START POINT
7575
pub fn start(save_info: [String; 4]) -> bool
76-
{
77-
if Path::new(storagePATH).exists() == true {
78-
write_file(save_info);
79-
return true;
80-
}
81-
else { return false; }
82-
}
76+
{ if (Path::new(storagePATH).exists() == true) { return write_file(save_info); } else { return false; } }
8377
}

0 commit comments

Comments
 (0)