Added mass and remove unecesary private (#41)
Co-authored-by: Zachary Levy <zachary@sunforge.is> Reviewed-on: #41
This commit was merged in pull request #41.
This commit is contained in:
@@ -7,7 +7,7 @@ Volts :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_milli_volts procedure group.
|
||||
volts_to_milli_volts :: #force_inline proc "contextless" (
|
||||
volts: Volts($V),
|
||||
) -> Milli_Volts(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -19,7 +19,7 @@ Milli_Volts :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
|
||||
v: V,
|
||||
}
|
||||
|
||||
@(private = "file")
|
||||
// Prefer the to_volts procedure group.
|
||||
milli_volts_to_volts :: #force_inline proc "contextless" (
|
||||
milli_volts: Milli_Volts($V),
|
||||
) -> Volts(V) where intrinsics.type_is_numeric(V) {
|
||||
@@ -30,11 +30,11 @@ milli_volts_to_volts :: #force_inline proc "contextless" (
|
||||
// ----- Conversion Overloads ------------------------
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
to_volts :: proc {
|
||||
milli_volts_to_volts,
|
||||
milli_volts_to_volts,
|
||||
}
|
||||
|
||||
to_milli_volts :: proc {
|
||||
volts_to_milli_volts,
|
||||
volts_to_milli_volts,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
@@ -52,8 +52,8 @@ test_volts_to_milli_volts :: proc(t: ^testing.T) {
|
||||
|
||||
@(test)
|
||||
test_milli_volts_to_volts :: proc(t: ^testing.T) {
|
||||
milli_volts := Milli_Volts(int){1000}
|
||||
volts := to_volts(milli_volts)
|
||||
milli_volts := Milli_Volts(int){1000}
|
||||
volts := to_volts(milli_volts)
|
||||
|
||||
testing.expect_value(t, volts, Volts(int){1})
|
||||
testing.expect_value(t, volts, Volts(int){1})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user