From e119ba8f1418d6a6babd8bb8af5d85e66f8b1b61 Mon Sep 17 00:00:00 2001 From: itiB Date: Thu, 7 Apr 2022 01:24:26 +0900 Subject: [PATCH 1/3] Fix: test file's path was incorrect --- src/options/level_tuning.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/options/level_tuning.rs b/src/options/level_tuning.rs index 94c9aef8..cc5e8adb 100644 --- a/src/options/level_tuning.rs +++ b/src/options/level_tuning.rs @@ -145,7 +145,7 @@ mod tests { level: high "#; - let path = "test_files/rules/level_tuning_sample.yml"; + let path = "test_files/rules/level_tuning.txt"; let mut file = File::create(path).unwrap(); let buf = rule_str.as_bytes(); file.write_all(buf).unwrap(); From 4056975b1dae8d4ab359681d9689330784855503 Mon Sep 17 00:00:00 2001 From: itiB Date: Thu, 7 Apr 2022 01:33:35 +0900 Subject: [PATCH 2/3] Add: add test_files/config/level_tuning.txt --- test_files/config/level_tuning.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 test_files/config/level_tuning.txt diff --git a/test_files/config/level_tuning.txt b/test_files/config/level_tuning.txt new file mode 100644 index 00000000..58a9604a --- /dev/null +++ b/test_files/config/level_tuning.txt @@ -0,0 +1,2 @@ +id,next_level +12345678-1234-1234-1234-123456789012,high \ No newline at end of file From f3a679d845936742a7867c0d6b50aaab121ed3d0 Mon Sep 17 00:00:00 2001 From: itiB Date: Thu, 7 Apr 2022 01:44:02 +0900 Subject: [PATCH 3/3] Add: Flush method. --- src/options/level_tuning.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/options/level_tuning.rs b/src/options/level_tuning.rs index cc5e8adb..4809e0d2 100644 --- a/src/options/level_tuning.rs +++ b/src/options/level_tuning.rs @@ -83,6 +83,7 @@ impl LevelTuning { }; file.write_all(content.as_bytes()).unwrap(); + file.flush().unwrap(); println!( "level: {} -> {}", rule["level"].as_str().unwrap(),