-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test case to Hamming that shows the difference between len()
and chars().count()
#128
Comments
In the case of hamming for DNA mutations the UTF-8 issue doesn't really come into play. Do we have any other exercises where we could expose this? |
In our current problem set? Not really. Anagrams can do it, but that's going to move much later in the sequence. Maybe in a problem we haven't implemented yet? |
Yeah, maybe, though there's nothing obvious in the list: http://exercism.io/languages/rust/contribute Maybe we need a new exercise that focuses on this explicitly. Go has the same thing. |
Since #175 now deals with the difference between bytes and characters, I think the original intent behind this is in fact covered, even if the test was added to a different exercise than Hamming. What say you? |
Sounds good. |
I see this solution a lot
But that's tricky in Rust because all strings are UTF-8 and the number of characters != the length of the string slice.
An example: https://play.rust-lang.org/?gist=b0fb8157fd7903333d9441164e0fffaf&version=stable&backtrace=0
I just saw this pop up in Hamming, so maybe exposing this difference via a test in that problem is a good idea.
The text was updated successfully, but these errors were encountered: