Skip to content

Commit aa64506

Browse files
committed
Remove old references to match
1 parent 2d86041 commit aa64506

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/pure/options.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
## echo "Never run" # the first statement returns a none option, which when
178178
## # compared to 2 returns another none option. This none option is then
179179
## # obviously not a some. Note that in this case it would be better to use
180-
## # a `match`.
180+
## # a `require`.
181181

182182
import typetraits
183183
import macros
@@ -233,13 +233,13 @@ proc isNone*[T](self: Option[T]): bool {.inline.} =
233233
else:
234234
not self.has
235235
236-
proc unsafeGet*[T](self: Option[T]): T {.deprecated: "Use `match`, `.?`, or " &
236+
proc unsafeGet*[T](self: Option[T]): T {.deprecated: "Use `require`, `.?`, or " &
237237
"special form `or` and `and` instead of manual checks".} =
238238
## Returns the value of a ``some``. Behavior is undefined for ``none``.
239239
assert self.isSome
240240
self.val
241241
242-
proc get*[T](self: Option[T]): T {.deprecated: "Use `match`, `.?`, or " &
242+
proc get*[T](self: Option[T]): T {.deprecated: "Use `require`, `.?`, or " &
243243
"special form `or` and `and` instead of manual checks".}=
244244
## Returns contents of the Option. If it is none, then an exception is
245245
## thrown.
@@ -609,7 +609,7 @@ macro wrapException*(statement: untyped): untyped =
609609
## let optParseInt = wrapException: parseInt(x: string)
610610
## # This will run the first parsing, then stop because it returns a some
611611
## # option with the exception.
612-
## match optParseInt("bob") or optParseInt("20"):
612+
## require optParseInt("bob") or optParseInt("20"):
613613
## just e: echo e.msg
614614
## none: echo "Execution succeded"
615615
assert(statement.len == 1)
@@ -650,7 +650,7 @@ macro wrapErrorCode*(statement: untyped): untyped =
650650
## let optParseInt = wrapErrorCode: parseInt(x: string)
651651
## # This will run the first parsing, then stop because it returns a some
652652
## # option with the "error code".
653-
## match optParseInt("10") or optParseInt("0"):
653+
## require optParseInt("10") or optParseInt("0"):
654654
## just e: echo "Got error code: ", e
655655
## none: echo "Execution succeded"
656656
assert(statement.len == 1)

0 commit comments

Comments
 (0)