Skip to content

Commit

Permalink
refactor: remove unnecessary explicit casts
Browse files Browse the repository at this point in the history
Zig is perfectly happy inferring these.
  • Loading branch information
elasticdog committed Aug 24, 2024
1 parent 7d54dc6 commit 461f518
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/theory/scale.zig
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ test "semitones calculation" {
test "scale degrees" {
var c_major = Scale.init(Note.c, .major);

try testing.expectEqual(@as(?u8, 1), c_major.degreeOf(Note.c));
try testing.expectEqual(@as(?u8, 4), c_major.degreeOf(Note.f));
try testing.expectEqual(@as(?u8, null), c_major.degreeOf(Note.f.sharp()));
try testing.expectEqual(1, c_major.degreeOf(Note.c));
try testing.expectEqual(4, c_major.degreeOf(Note.f));
try testing.expectEqual(null, c_major.degreeOf(Note.f.sharp()));

try testing.expectEqual(Note.c, c_major.nthDegree(1).?);
try testing.expectEqual(Note.g, c_major.nthDegree(5).?);
Expand All @@ -197,7 +197,7 @@ test "scale spellings" {

try testing.expectEqual(Note.e, c_major.getScaleSpelling(Note.f.flat()).?);
try testing.expectEqual(Note.b, c_major.getScaleSpelling(Note.c.flat()).?);
try testing.expectEqual(@as(?Note, null), c_major.getScaleSpelling(Note.f.sharp()));
try testing.expectEqual(null, c_major.getScaleSpelling(Note.f.sharp()));
}

test "scale contains note" {
Expand Down

0 comments on commit 461f518

Please sign in to comment.