@@ -4,15 +4,15 @@ The types `char` and `str` hold textual data.
4
4
5
5
A value of type ` char ` is a [ Unicode scalar value] (i.e. a code point that is
6
6
not a surrogate), represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
7
- or 0xE000 to 0x10FFFF range. It is immediate [ Undefined Behavior ] to create a
7
+ or 0xE000 to 0x10FFFF range. It is immediate [ undefined behavior ] to create a
8
8
` char ` that falls outside this range. A ` [char] ` is effectively a UCS-4 / UTF-32
9
9
string of length 1.
10
10
11
11
A value of type ` str ` is represented the same way as ` [u8] ` , a slice of
12
12
8-bit unsigned bytes. However, the Rust standard library makes extra assumptions
13
13
about ` str ` : methods working on ` str ` assume and ensure that the data in there
14
14
is valid UTF-8. Calling a ` str ` method with a non-UTF-8 buffer can cause
15
- [ Undefined Behavior ] now or in the future.
15
+ [ undefined behavior ] now or in the future.
16
16
17
17
Since ` str ` is a [ dynamically sized type] , it can only be instantiated through a
18
18
pointer type, such as ` &str ` .
@@ -26,5 +26,5 @@ Every byte of a `char` is guaranteed to be initialized (in other words,
26
26
some bit patterns are invalid ` char ` s, the inverse is not always sound).
27
27
28
28
[ Unicode scalar value ] : http://www.unicode.org/glossary/#unicode_scalar_value
29
- [ Undefined Behavior ] : ../behavior-considered-undefined.md
29
+ [ undefined behavior ] : ../behavior-considered-undefined.md
30
30
[ dynamically sized type ] : ../dynamically-sized-types.md
0 commit comments