diff --git a/task-maker-exec/src/lib.rs b/task-maker-exec/src/lib.rs index 8b8f9f49d..bbb9748a5 100644 --- a/task-maker-exec/src/lib.rs +++ b/task-maker-exec/src/lib.rs @@ -238,7 +238,7 @@ mod tests { cwd.path(), 1000, 1000, - UnsafeSandboxRunner::default(), + UnsafeSandboxRunner, ); assert!(exec_done2.load(Ordering::Relaxed)); diff --git a/task-maker-exec/src/sandbox.rs b/task-maker-exec/src/sandbox.rs index be8be1ca5..044e2b031 100644 --- a/task-maker-exec/src/sandbox.rs +++ b/task-maker-exec/src/sandbox.rs @@ -618,7 +618,7 @@ mod tests { exec.limits_mut().read_only(true); let sandbox = Sandbox::new(tmpdir.path(), &exec, &HashMap::new(), None).unwrap(); let outfile = sandbox.output_path(Path::new("fooo")); - if let Err(e) = sandbox.run(&ErrorSandboxRunner::default()) { + if let Err(e) = sandbox.run(&ErrorSandboxRunner) { assert!(e.to_string().contains("Nope")); } else { panic!("Sandbox not called"); diff --git a/task-maker-format/src/ioi/sanity_checks/subtasks.rs b/task-maker-format/src/ioi/sanity_checks/subtasks.rs index f468d8f3b..3d01d7df0 100644 --- a/task-maker-format/src/ioi/sanity_checks/subtasks.rs +++ b/task-maker-format/src/ioi/sanity_checks/subtasks.rs @@ -201,7 +201,9 @@ impl SanityCheck for AllOutputsEqual { let outputs = self.outputs.lock().unwrap(); for (id, out) in outputs.iter() { - let Some(subtask) = task.subtasks.get(id) else { continue; }; + let Some(subtask) = task.subtasks.get(id) else { + continue; + }; if out.len() != subtask.testcases.len() { continue; } diff --git a/task-maker-format/src/ioi/sanity_checks/task.rs b/task-maker-format/src/ioi/sanity_checks/task.rs index bc7b221ac..8c57d35b6 100644 --- a/task-maker-format/src/ioi/sanity_checks/task.rs +++ b/task-maker-format/src/ioi/sanity_checks/task.rs @@ -97,7 +97,7 @@ impl SanityCheck for NoBitsStdCpp { fn pre_hook(&self, task: &IOITask, eval: &mut EvaluationData) -> Result<(), Error> { lazy_static! { static ref RE: Regex = - Regex::new(r###"(?m)^#\s*include\s*(?:<|")bits/stdc\+\+\.h(?:>|").*$"###) + Regex::new(r#"(?m)^#\s*include\s*(?:<|")bits/stdc\+\+\.h(?:>|").*$"#) .expect("Invalid regex"); } diff --git a/task-maker-format/src/ioi/statement/statement.rs b/task-maker-format/src/ioi/statement/statement.rs index 9ddd281ca..96b17ebda 100644 --- a/task-maker-format/src/ioi/statement/statement.rs +++ b/task-maker-format/src/ioi/statement/statement.rs @@ -314,8 +314,8 @@ mod tests { let logo2 = Some(logo); let mut eval = EvaluationData::new(tmpdir.path()).0; - let in_files = vec!["logo.pdf", "test.png", "asset.pdf"]; - let not_in_files = vec!["asy_image.pdf", "tex_file.pdf"]; + let in_files = ["logo.pdf", "test.png", "asset.pdf"]; + let not_in_files = ["asy_image.pdf", "tex_file.pdf"]; std::fs::write(tmpdir.path().join("asy_image.asy"), "").unwrap(); std::fs::write(tmpdir.path().join("tex_file.tex"), "").unwrap(); diff --git a/task-maker-format/src/ioi/ui_state.rs b/task-maker-format/src/ioi/ui_state.rs index 1bb648f4d..755240eda 100644 --- a/task-maker-format/src/ioi/ui_state.rs +++ b/task-maker-format/src/ioi/ui_state.rs @@ -541,7 +541,7 @@ impl UIStateT for UIState { .entry(solution) .or_insert_with(|| SolutionEvaluationState::new(task)); let subtask = eval.subtasks.get_mut(&subtask).expect("Missing subtask"); - let mut testcase = subtask + let testcase = subtask .testcases .get_mut(&testcase) .expect("Missing testcase"); @@ -599,7 +599,7 @@ impl UIStateT for UIState { .entry(solution) .or_insert_with(|| SolutionEvaluationState::new(task)); let subtask = eval.subtasks.get_mut(&subtask).expect("Missing subtask"); - let mut testcase = subtask + let testcase = subtask .testcases .get_mut(&testcase) .expect("Missing testcase"); @@ -626,7 +626,7 @@ impl UIStateT for UIState { .entry(solution) .or_insert_with(|| SolutionEvaluationState::new(task)); let subtask = eval.subtasks.get_mut(&subtask).expect("Missing subtask"); - let mut testcase = subtask + let testcase = subtask .testcases .get_mut(&testcase) .expect("Missing testcase"); @@ -650,7 +650,7 @@ impl UIStateT for UIState { .evaluations .entry(solution) .or_insert_with(|| SolutionEvaluationState::new(task)); - let mut subtask = eval.subtasks.get_mut(&subtask).expect("Missing subtask"); + let subtask = eval.subtasks.get_mut(&subtask).expect("Missing subtask"); subtask.score = Some(score); subtask.normalized_score = Some(normalized_score); } diff --git a/task-maker-format/src/lib.rs b/task-maker-format/src/lib.rs index f716ceba8..c89c11442 100644 --- a/task-maker-format/src/lib.rs +++ b/task-maker-format/src/lib.rs @@ -41,7 +41,6 @@ use task_maker_lang::{GraderMap, LanguageManager}; use crate::ioi::task_info::IOITaskInfo; use crate::ioi::IOITask; -use crate::solution::Solution; pub use crate::solution::*; use crate::terry::{Seed, TerryTask}; use crate::ui::UI; diff --git a/task-maker-format/src/ui/curses.rs b/task-maker-format/src/ui/curses.rs index 2e4afdfa6..38b4ebdab 100644 --- a/task-maker-format/src/ui/curses.rs +++ b/task-maker-format/src/ui/curses.rs @@ -141,7 +141,7 @@ where Ok(std::thread::Builder::new() .name("CursesUI thread".to_owned()) .spawn(move || { - let loading = vec!['◐', '◓', '◑', '◒']; + let loading = ['◐', '◓', '◑', '◒']; let mut loading_index = 0; let stdin = termion::async_stdin(); let mut events = stdin.events(); diff --git a/task-maker-lang/src/languages/cpp.rs b/task-maker-lang/src/languages/cpp.rs index ba893374e..7092e909d 100644 --- a/task-maker-lang/src/languages/cpp.rs +++ b/task-maker-lang/src/languages/cpp.rs @@ -233,7 +233,7 @@ mod tests { ) .unwrap(); let imports = extract_includes(&path); - for (i, import) in vec!["iostream", "test.hpp"].iter().enumerate() { + for (i, import) in ["iostream", "test.hpp"].iter().enumerate() { let import = PathBuf::from(import); assert_that(&imports[i].0).is_equal_to(tmpdir.path().join(&import)); assert_that(&imports[i].1).is_equal_to(&import); diff --git a/task-maker-lang/src/languages/python.rs b/task-maker-lang/src/languages/python.rs index ae1e5761c..59605e2d4 100644 --- a/task-maker-lang/src/languages/python.rs +++ b/task-maker-lang/src/languages/python.rs @@ -168,7 +168,7 @@ mod tests { ) .unwrap(); let imports = extract_imports(&path); - for (i, import) in vec!["foo", "bar", "baz", "biz"].iter().enumerate() { + for (i, import) in ["foo", "bar", "baz", "biz"].iter().enumerate() { let import = PathBuf::from(format!("{}.py", import)); assert_that(&imports[i]).is_equal_to((import.clone(), import)); } diff --git a/task-maker-lang/src/source_file.rs b/task-maker-lang/src/source_file.rs index b9a9af530..e835cd59d 100644 --- a/task-maker-lang/src/source_file.rs +++ b/task-maker-lang/src/source_file.rs @@ -379,7 +379,7 @@ mod tests { cwd.path(), 1000, 1000, - SuccessSandboxRunner::default(), + SuccessSandboxRunner, ); assert!(exec_start.load(Ordering::Relaxed));