def Duration.borrow

bend-kit-time@0.3.0.0 · time.bend:85

import bend-kit-time@0.3.0.0/time.bend as Time
import Base
import bend-kit-int@0.2.0.0/int.bend as Int

85# n is na - nb, wrapped when na < nb.
86def Duration.borrow(c: Bool, s: Int.I64, +n: U32) -> Duration:
87  match c:
88    case True{}:
89      Duration{Int.I64.sub(s, i64(1)), (n + 1000000000 : U32)}
90    case False{}:
91      Duration{s, n}

Uses (7)

Used by (1)