Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
@kazk It worked. Thanks for the explanations :)
OK. Lot of thanks for your explanations and your work to fix that. I tried a solution without regex and it works!
@filosfino Can you try again? It should be fixed now.
@g964
I didn't realize this problem when a user can optionally use some crate and I don't think there's a way to completely fix it.
The workaround was to bind to a different identifier.
You can also move
extern crate
insidemod tests
and douse self::regex::Regex;
. I don't know which one is better. If Rust users have opinions, please let me know.Another workaround might be to avoid
use regex::Regex;
and just doregex::Regex::new
in the reference solution.OK, I'll try and let you know.
I am lost:-( Maybe it would be better if you fix it!
@g964 I think it validated because your solution contains the declaration.
To use crates in test, do
I'll try fixing it if you want.
@filosfino
See Rust wiki page for the list of crates.
For self::, it's because Rust 1.15 is a huge hack on Codewars for historical reasons. It's fixed on 1.25/1.33. See List of Rust 1.15 kata to update.(this was caused by invalid test code)I will try again...
Sorry for the inconvenience!
Check this one :) BTW is there any document specifying how the crates could be used in the answer?
error[E0432]: unresolved import
regex
--> src/lib.rs:25:9
|
25 | use regex::Regex;
| ^^^^^ did you mean
self::regex
?Fixed, thanks!
This comment is hidden because it contains spoiler information about the solution
(Rust) use usize as return type instead of u8