From ce75042a9dbf51707da6175157df8ebc22bd516b Mon Sep 17 00:00:00 2001 From: Leon Lysak Date: Sat, 6 Jul 2024 16:51:15 -0400 Subject: [PATCH] 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. --- lib/pure/strutils.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index a9e3df53e4..81be7db179 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