-
Notifications
You must be signed in to change notification settings - Fork 523
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
hamming: Updated the exercise to the 2.1.1 version #762
Conversation
@@ -1,14 +1,21 @@ | |||
extern crate hamming; | |||
|
|||
fn process_distance_case(strand_pair: [&str; 2], expected_distance: Option<usize>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why you wrote this as [&str; 2]
instead of (&str, &str)
. I tend to think of function arguments as tuple-like instead of array-like, so the latter would have seemed more natural to me.
I suspect that the two forms are equivalent in memory, and this does work; you certainly don't need to change it. I'm just curious about your design process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess I decided to go with the array, because the types of the variables are similar (perhaps a little C-like design).
If the strands where represented with different types, e.g. LeftStrand
/ RightStrand
, then I would surely used the tuple.
Since this also updates the README, exercism/problem-specifications#1360 is now also relevant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the ordering isn't the same as what's in canonical-data.json (and I also couldn't find much of a rhyme or reason to this new order), for this exercise I find that I do not really care about the order
Relevant PRs: 1) Test cases: - exercism/problem-specifications#625 - exercism/problem-specifications#844 - exercism/problem-specifications#845 - exercism/problem-specifications#875 - exercism/problem-specifications#953 - exercism/problem-specifications#1129 - exercism/problem-specifications#1389 2) README: - exercism/problem-specifications#1360 Basically adds every test case from the current canonical-data.json without deleting the old ones.
…y formatting in the uninplemented message
…th the process_distance_case function
b317772
to
29fa868
Compare
Relevant PRs:
- exercism/problem-specifications#625
- exercism/problem-specifications#844
- exercism/problem-specifications#845
- exercism/problem-specifications#875
- exercism/problem-specifications#953
- exercism/problem-specifications#1129
- exercism/problem-specifications#1389
Basically adds every test case from the current canonical-data.json without deleting the old ones.