hamming: Updated the exercise to the 2.1.1 version#762
hamming: Updated the exercise to the 2.1.1 version#762coriolinus merged 3 commits intoexercism:masterfrom
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.
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.
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. |
petertseng
left a comment
There was a problem hiding this comment.
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.