Checker fixes

This commit is contained in:
Kivanc 2025-12-11 13:54:17 +03:00
parent 61824af087
commit 2b5356aab5
3 changed files with 7 additions and 7 deletions

View File

@ -13,8 +13,8 @@ fn main() {
assert_eq!("This is the file content.", contents);
}
Err(e) => {
eprintln!("Error reading file: {}", e);
assert!(false);
panic!("Error reading file.");
}
}
}

View File

@ -48,11 +48,11 @@ fn main() {
fn create_required_files(){
let file_path = Path::new(TEST_FILE_NAME);
if file_path.exists() == false {
if !file_path.exists() {
let text = "This is the first line of the text.
This is the second line.
And this is the third and the last line.";
fs::write(&file_path, text).unwrap();
fs::write(file_path, text).unwrap();
println!("File created.");
}

View File

@ -33,17 +33,17 @@ fn create_required_files(){
let dir_path = file_path.parent().unwrap();
if dir_path.exists() == false {
if !dir_path.exists() {
fs::create_dir(dir_path).unwrap();
println!("Created directory {:?}", dir_path);
}
if file_path.exists() == false {
if !file_path.exists(){
let text = "This is the first line of the text.
This is the second line.
And this is the third and the last line.";
fs::write(&file_path, text).unwrap();
fs::write(file_path, text).unwrap();
println!("File created.");
}