Skip to content

Commit

Permalink
Millis as Newtype
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Dec 20, 2023
1 parent 0e3a87b commit 30d78e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
)

type Millis = int64
type Millis int64

// TODO: we really need more precise error reported for timestamp tokens.
// Like the diagnostics should point out at specific characters that are
Expand All @@ -25,7 +25,7 @@ func parseSsAndMs(s string) (ss int64, ms Millis, err error) {
for i := 0; i < 3; i += 1 {
ms = ms*10
if i < len(runes) {
ms += int64(runes[i] - '0')
ms += Millis(runes[i] - '0')
}
}
return
Expand Down

0 comments on commit 30d78e5

Please sign in to comment.