diff --git a/rust/subjects/01/README.md b/rust/subjects/01/README.md index 85e3f2c..e083de5 100755 --- a/rust/subjects/01/README.md +++ b/rust/subjects/01/README.md @@ -313,6 +313,7 @@ assert_eq!(big_add(b"0010", b"0200"), b"210"); ```rust // allowed symbols +use slice::*; use std::{ vec::Vec::*, iter::*, @@ -336,13 +337,13 @@ pub struct Task { For a task `i`: * `tasks[i].start_time` is the start time for `task[i]` * `tasks[i].end_time` is the end time for `task[i]` -* `tasks[i].cookies` is how many cookies he will get from students for finishing `task[i]` +* `tasks[i].cookies` is how many cookies he will get for finishing `task[i]` Unfortunately, he sucks at multitasking. Write a **function** which returns the maximum amount of cookies he can get without any tasks overlapping. Your function must have this signature: ```rust -pub fn time_manager(tasks: &mut Vec) -> u32 +pub fn time_manager(tasks: &mut [Task]) -> u32 ``` **Constraints** diff --git a/rust/tester/src/module01/exercise07/shortinette_tests.rs b/rust/tester/src/module01/exercise07/shortinette_tests.rs index c81a121..f2ebf1b 100644 --- a/rust/tester/src/module01/exercise07/shortinette_tests.rs +++ b/rust/tester/src/module01/exercise07/shortinette_tests.rs @@ -1,9 +1,9 @@ #[cfg(test)] mod shortinette_tests_rust_0107 { - use ex07::time_manager; use ex07::Task; - use rand::seq::SliceRandom; + use ex07::time_manager; use rand::Rng; + use rand::seq::SliceRandom; use std::fmt::{Display, Error, Formatter}; struct Testcase { @@ -25,7 +25,11 @@ mod shortinette_tests_rust_0107 { ) }) .collect(); - write!(f, "{:?}", strings) + write!( + f, + "{:?} (formatted as Task {{ start_time, end_time, cookies }})", + strings + ) } }