def v6.field.if

bend-kit-netip@0.1.0.0 · netip.bend:302

import bend-kit-netip@0.1.0.0/netip.bend as Netip
import Base

302def v6.field.if(inside: Bool, n: U32, +i: U32, start: U32, end: U32) -> String:
303  match inside:
304    case True{}:
305      Bool.pick(String, U32.is_eq(i, start), "::", "")
306    case False{}:
307      Bool.pick(String, Bool.or(U32.is_zero(i), U32.is_eq(i, end)), "", ":") ++ hex.group(n)

Uses (9)

Used by (1)