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.
This commit is contained in:
Leon Lysak
2024-07-06 16:51:15 -04:00
committed by GitHub
parent 841d30a213
commit ce75042a9d

View File

@@ -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