Fix Str.startsWithCodePoint docs

This commit is contained in:
Richard Feldman 2021-05-02 22:16:58 -04:00
parent 465c5fa18a
commit 83dde26cd0
2 changed files with 3 additions and 3 deletions

View file

@ -161,8 +161,8 @@ startsWith : Str, Str -> Bool
## in a single code point, you can use (for example) `Str.startsWithCodePoint '鹏'` ## in a single code point, you can use (for example) `Str.startsWithCodePoint '鹏'`
## instead of `Str.startsWithCodePoint "鹏"`. ('鹏' evaluates to the [U32] ## instead of `Str.startsWithCodePoint "鹏"`. ('鹏' evaluates to the [U32]
## value `40527`.) This will not work for graphemes which take up mulitple code ## value `40527`.) This will not work for graphemes which take up mulitple code
## points, however; `Str.startsWithCodePoint '🕊'` would be a compiler error ## points, however; `Str.startsWithCodePoint '👩‍👩‍👦‍👦'` would be a compiler error
## because 🕊 takes up multiple code points and cannot be represented as a ## because 👩‍👩‍👦‍👦 takes up multiple code points and cannot be represented as a
## single [U32]. You'd need to use `Str.startsWithCodePoint "🕊"` instead. ## single [U32]. You'd need to use `Str.startsWithCodePoint "🕊"` instead.
startsWithCodePoint : Str, U32 -> Bool startsWithCodePoint : Str, U32 -> Bool

View file

@ -428,7 +428,7 @@ fn str_starts_with_code_point() {
bool bool
); );
assert_evals_to!( assert_evals_to!(
&format!(r#"Str.startsWithCodePoint "boobar" {}"#, 'f' as u32), &format!(r#"Str.startsWithCodePoint "zoobar" {}"#, 'f' as u32),
false, false,
bool bool
); );