I think usize would be a better choice for the format of the "length" parameter.
I have forked it.
Thanks for taking a look!
Thank you :-)
I like the use of mem::swap on gcd() function. Good work!
approved by someone
Oh, cool. And due to it being Cow I assume it saves some calls to .to_owned() for the else branch, as Join takes &str.
I'll look into this some more. Thanks for the fork! :-)
I just saw this today in the source of regex crate, I'm not 100% sure how it works yet, but I assume to_owned shouldn't be called here because there's nothing that needs specifically a String: it's Vec<Cow<_>> and then Join just uses Borrow<str>.
Oh, interesting! Do you mind explaining what exactly the difference is in this case? I thought it would end up calling .to_owned() on the string slice regardless?
Forked, updated to 1.50 and hopefully fixed.
It should be fixed here: https://www.codewars.com/kumite/60637c75fb053700324c175d?sel=60648e7477c71400430cb9df