fix(doc): wrong example

This commit is contained in:
Victor Westerlund 2023-06-12 12:12:59 +02:00 committed by GitHub
parent 6644be84ae
commit 243abfc531
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,9 +16,9 @@ enum HelloWorld: string {
case BAZ = "QUX"; case BAZ = "QUX";
} }
// Like Enum::tryFrom() but for Enum names instead of values // Like Enum::from() but for Enum names instead of values
HelloWorld::fromName("FOO"); // HelloWorld::FOO HelloWorld::fromName("FOO"); // HelloWorld::FOO
// .. and of course the non-throwing version // And of course the non-throwing version similar to Enum::tryFrom()
HelloWorld::tryFromName("MOM"); // null HelloWorld::tryFromName("MOM"); // null
``` ```