Fixing typos or missing elements. (#19)

* OCD

* Update k_macros.rs
This commit is contained in:
Tomasz Drwięga
2023-10-17 19:30:46 +02:00
committed by GitHub
parent c5e230f8ab
commit 0ec00e1850
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -258,7 +258,7 @@ pub fn answer_6() -> char {
///
/// fn string_to_int_in_range(s: String) -> Result<u32, OutOfRangeError> {
/// // Given: The u32::from_str_radix function returns Result<u32, ParseIntError>
/// 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),
+4 -1
View File
@@ -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<u32>` 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<u32>`
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.