1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-12-02 09:12:01 +02:00

Use todo!() instead of ???

This commit is contained in:
mo8it 2024-06-28 02:26:35 +02:00
parent cf9041c0e4
commit 4f71f74b44
2 changed files with 6 additions and 6 deletions

View File

@ -29,8 +29,8 @@ mod tests {
// TODO: This test should check if the rectangle has the size that we
// pass to its constructor.
let rect = Rectangle::new(10, 20);
assert_eq!(???, 10); // Check width
assert_eq!(???, 20); // Check height
assert_eq!(todo!(), 10); // Check width
assert_eq!(todo!(), 20); // Check height
}
// TODO: This test should check if the program panics when we try to create

View File

@ -13,13 +13,13 @@ mod tests {
let my_fav_fruits = ["banana", "custard apple", "avocado", "peach", "raspberry"];
// TODO: Create an iterator over the array.
let mut fav_fruits_iterator = ???;
let mut fav_fruits_iterator = todo!();
assert_eq!(fav_fruits_iterator.next(), Some(&"banana"));
assert_eq!(fav_fruits_iterator.next(), ???); // TODO: Replace `???`
assert_eq!(fav_fruits_iterator.next(), todo!()); // TODO: Replace `todo!()`
assert_eq!(fav_fruits_iterator.next(), Some(&"avocado"));
assert_eq!(fav_fruits_iterator.next(), ???); // TODO: Replace `???`
assert_eq!(fav_fruits_iterator.next(), todo!()); // TODO: Replace `todo!()`
assert_eq!(fav_fruits_iterator.next(), Some(&"raspberry"));
assert_eq!(fav_fruits_iterator.next(), ???); // TODO: Replace `???`
assert_eq!(fav_fruits_iterator.next(), todo!()); // TODO: Replace `todo!()`
}
}