Skip to content

Commit bd74860

Browse files
committed
clarify representation
1 parent 3c6a8f4 commit bd74860

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/types/textual.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ or 0xE000 to 0x10FFFF range. It is immediate [Undefined Behavior] to create a
99
string of length 1.
1010

1111
A value of type `str` is a Unicode string, represented as an array of 8-bit
12-
unsigned bytes holding a sequence of UTF-8 code points. Note that this is a
13-
library-level invariant: for the compiler and core language specification, `str`
14-
is the same as `[u8]`, but methods working on `str` may assume that the data in
15-
there is valid UTF-8 and may cause Undefined Behavior otherwise. Since `str` is
16-
a [dynamically sized type], it can only be instantiated through a pointer type,
17-
such as `&str`.
12+
unsigned bytes holding a sequence of UTF-8 encoded Unicode code points. Note
13+
that this is a library-level invariant: for the compiler and core language
14+
specification, `str` is the same as `[u8]`, but methods working on `str` may
15+
assume that the data in there is valid UTF-8 and may cause Undefined Behavior
16+
otherwise. Since `str` is a [dynamically sized type], it can only be
17+
instantiated through a pointer type, such as `&str`.
1818

1919
[Unicode scalar value]: http://www.unicode.org/glossary/#unicode_scalar_value
2020
[Undefined Behavior]: ../behavior-considered-undefined.md

0 commit comments

Comments
 (0)