Ad
  • Default User Avatar

    Thanks for your very quick reply, you're absolutely right. Works now :-)

  • Default User Avatar

    Hi! I'm facing a problem in the Rust version.

    Initial tests pass 100% OK, but when submitting for full test suite, the following appears:

    Thank you


    Time: 1060ms Errors: 1Exit Code: 101
    STDERR:
    error[E0308]: mismatched types
    --> src/lib.rs:81:59
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n.try_into().unwrap(), k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:81:62
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    81 | assert_eq!(find_all(n, k), reference_solution(n, k.try_into().unwrap()), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:87:59
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n.try_into().unwrap(), k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:87:62
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    87 | assert_eq!(find_all(n, k), reference_solution(n, k.try_into().unwrap()), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:93:59
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n.try_into().unwrap(), k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    error[E0308]: mismatched types
    --> src/lib.rs:93:62
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n, k), "\nWith sum_dig = {}, digs = {}", n, k);
    | ^ expected u8, found i32
    |
    help: you can convert an i32 to a u8 and panic if the converted value doesn't fit
    |
    93 | assert_eq!(find_all(n, k), reference_solution(n, k.try_into().unwrap()), "\nWith sum_dig = {}, digs = {}", n, k);
    | ++++++++++++++++++++

    For more information about this error, try rustc --explain E0308.
    error: could not compile challenge due to 6 previous errors

    NOTE: Line numbers in error messages can be incorrect due to concatenation.