diff options
author | bptato <nincsnevem662@gmail.com> | 2024-05-05 00:07:16 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-05-05 00:07:16 +0200 |
commit | c06bc25969bc428c3b2a32ee87525737cb5fef9f (patch) | |
tree | 17a90ad69fb3ae89e8923021dca6cfc105809875 /src/css | |
parent | 698b6002528750a7af0a0df9ccac8e05d6b923c8 (diff) | |
download | chawan-c06bc25969bc428c3b2a32ee87525737cb5fef9f.tar.gz |
Use isSome instead of isOk
no point in having identical overloads
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/mediaquery.nim | 2 | ||||
-rw-r--r-- | src/css/values.nim | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/css/mediaquery.nim b/src/css/mediaquery.nim index 5b033e8e..866f6c89 100644 --- a/src/css/mediaquery.nim +++ b/src/css/mediaquery.nim @@ -256,7 +256,7 @@ template expect_int_range(range: var Slice[int]; ismin, ismax: bool) = template expect_length(length: var CSSLength) = let cval = parser.consume() let r = cssLength(cval) - if r.isErr: + if r.isNone: return nil length = r.get diff --git a/src/css/values.nim b/src/css/values.nim index 7150de59..b696f0e4 100644 --- a/src/css/values.nim +++ b/src/css/values.nim @@ -1335,9 +1335,9 @@ proc parseComputedValues*(res: var seq[CSSComputedEntry]; name: string; for tok in cvals: if tok == cttWhitespace: continue - if (let r = cssImage(tok); r.isOk): + if (let r = cssImage(tok); r.isSome): bgimageval = CSSComputedValue(v: cvtImage, image: r.get) - elif (let r = cssColor(tok); r.isOk): + elif (let r = cssColor(tok); r.isSome): bgcolorval = CSSComputedValue(v: cvtColor, color: r.get) else: #TODO when we implement the other shorthands too @@ -1354,12 +1354,12 @@ proc parseComputedValues*(res: var seq[CSSComputedEntry]; name: string; for tok in cvals: if tok == cttWhitespace: continue - if (let r = parseIdent[CSSListStylePosition](tok); r.isOk): + if (let r = parseIdent[CSSListStylePosition](tok); r.isSome): positionVal = CSSComputedValue( v: cvtListStylePosition, liststyleposition: r.get ) - elif (let r = parseIdent[CSSListStyleType](tok); r.isOk): + elif (let r = parseIdent[CSSListStyleType](tok); r.isSome): typeVal = CSSComputedValue( v: cvtListStyleType, liststyletype: r.get @@ -1436,7 +1436,7 @@ proc parseComputedValues*(res: var seq[CSSComputedEntry]; name: string; proc parseComputedValues*(name: string; value: seq[CSSComponentValue]): seq[CSSComputedEntry] = var res: seq[CSSComputedEntry] = @[] - if res.parseComputedValues(name, value).isOk: + if res.parseComputedValues(name, value).isSome: return res return @[] |