Ad
  • Default User Avatar

    Honestly I din't know about the min function either, but was also able to do it with a loop. I personally think that will help you in the long run. You can learn all the shortcuts later, if you know how to work through the problem without a built in function, that's great imo.

  • Default User Avatar

    Thanks for the help.
    modified the tests, remove all Option and ... submited !
    Thanks.

  • Custom User Avatar

    Neither sample tests nor the submission tests expect an Option. This was discussed in the translation discourse and it was decided that the inclusion of a few negative numbers just for the sake of including a few negative numbers was silly.
    It is possible that you opened the kata in the small window when the translation was published, but the sample tests still had the Option as an expected result (see issue raised by Unnamed below). If so, you can either ignore the sample tests or reload/reset the kata to see the updated sample tests. I would suggest simply ignoring them. The expected return value is a String, so just use that.

  • Default User Avatar

    Yes as requested by the tests :

    Ok(...)
    Except for negative input, returns None.

    "Test" is ok.
    "Attempt" is not.

  • Custom User Avatar

    Is your solution returning an Option?

  • Default User Avatar

    tests ok, even fact(800)...
    But when attempt :

    error[E0277]: can't compare String with Option<String>
    --> src/lib.rs:131:26
    |
    131 | assert!(expected == actual, "For number {num}\nExpected:\n{expected:?}\nActual:\n{actual:?}");
    | ^^ no implementation for String == Option<String>
    |

    Rust tests are not ok.

  • Default User Avatar

    seconds % 3600 % 60 could be only
    seconds % 60