diff options
author | Leon Lysak <leon.l.lysak@gmail.com> | 2024-07-06 16:51:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-06 22:51:15 +0200 |
commit | ce75042a9dbf51707da6175157df8ebc22bd516b (patch) | |
tree | 98442cb9ee9aa1e51580d8ab829e4db9d2713203 /lib | |
parent | 841d30a213720813130c410a15bee79dd00d5ccf (diff) | |
download | Nim-ce75042a9dbf51707da6175157df8ebc22bd516b.tar.gz |
Update documentation for parseEnum in strutils.nim (#23804)
added small note regarding style insensitivity for parsing enums. the casing of the first letter is still taken into account for this function. was confused a little at first because when I read "style insensitive manner" I thought it meant casing as well and ran into a couple of `ValueError`'s because of it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/strutils.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index a9e3df53e..81be7db17 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -1307,7 +1307,7 @@ func parseEnum*[T: enum](s: string): T = ## type contains multiple fields with the same string value. ## ## Raises `ValueError` for an invalid value in `s`. The comparison is - ## done in a style insensitive way. + ## done in a style insensitive way (first letter is still case-sensitive). runnableExamples: type MyEnum = enum @@ -1327,7 +1327,7 @@ func parseEnum*[T: enum](s: string, default: T): T = ## type contains multiple fields with the same string value. ## ## Uses `default` for an invalid value in `s`. The comparison is done in a - ## style insensitive way. + ## style insensitive way (first letter is still case-sensitive). runnableExamples: type MyEnum = enum |