Skip to content

Commit

Permalink
exercises(hamming): example: don't call a u8 a rune
Browse files Browse the repository at this point in the history
Avoid potential confusion - this isn't yielding unicode code points.
  • Loading branch information
ee7 authored and booniepepper committed Oct 5, 2023
1 parent 0ea09a2 commit f998a62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exercises/practice/hamming/.meta/example.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ pub fn compute(first: []const u8, second: []const u8) DnaError!usize {
return DnaError.UnequalDnaStrands;
}
var hamming_distance: usize = 0;
for (first, 0..) |rune, i| {
if (rune != second[i]) {
for (first, 0..) |c, i| {
if (c != second[i]) {
hamming_distance += 1;
}
}
Expand Down

0 comments on commit f998a62

Please sign in to comment.