From 0ec00e185087d05ae61ac63975217d4dcbd7756f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 17 Oct 2023 19:30:46 +0200 Subject: [PATCH] Fixing typos or missing elements. (#19) * OCD * Update k_macros.rs --- src/b_multiple_choice.rs | 2 +- src/k_macros.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/b_multiple_choice.rs b/src/b_multiple_choice.rs index ba343c9..8f9f24d 100644 --- a/src/b_multiple_choice.rs +++ b/src/b_multiple_choice.rs @@ -258,7 +258,7 @@ pub fn answer_6() -> char { /// /// fn string_to_int_in_range(s: String) -> Result { /// // Given: The u32::from_str_radix function returns Result -/// let n: u32 = u32::from_str_radix(&s,10)?; +/// let n: u32 = u32::from_str_radix(&s, 10)?; /// /// match n { /// n if n < 5 => Err(OutOfRangeError::TooSmall), diff --git a/src/k_macros.rs b/src/k_macros.rs index e3107fc..c3c28f4 100644 --- a/src/k_macros.rs +++ b/src/k_macros.rs @@ -25,7 +25,7 @@ macro_rules! map { /// generate this implementation for us, as such: /// /// ``` -/// use pba_qualifier_exam:impl_get; +/// use pba_qualifier_exam::impl_get; /// impl_get! { /// // implements `Get` for `struct Six` /// Six: u32 = 6; @@ -89,6 +89,8 @@ mod tests { #[test] fn impl_get() { + use super::Get; + impl_get!( // should generate `struct Foo` that implements `Get` Foo: u32 = 10; @@ -102,6 +104,7 @@ mod tests { // assert_eq!(Foo::get(), 10); // assert_eq!(Bar::get(), 42); // assert_eq!(Baz::get(), 21); + assert_eq!(true, false, "Make sure to remove this line and uncomment the tests above"); // As an extra, ungraded, challenge, try to make this work. // This is not part of the main problem because it requires the nightly compiler.