Skip to content

Commit d9a6e86

Browse files
committed
Fixup primitive.str docs
Remove broken links that should just point to the current page, and while we're at it, re-wrap to 100 chars.
1 parent 80bf31d commit d9a6e86

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

src/libcollections/str.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
//
1111
// ignore-lexer-test FIXME #15679
1212

13-
//! Unicode string manipulation (the [`str`](../primitive.str.html) type).
13+
//! Unicode string manipulation (the `str` type).
1414
//!
15-
//! Rust's [`str`](../primitive.str.html) type is one of the core primitive
16-
//! types of the language. `&str` is the borrowed string type. This type of
17-
//! string can only be created from other strings, unless it is a `&'static str`
18-
//! (see below). It is not possible to move out of borrowed strings because they
19-
//! are owned elsewhere.
15+
//! Rust's `str` type is one of the core primitive types of the language. `&str` is the borrowed
16+
//! string type. This type of string can only be created from other strings, unless it is a
17+
//! `&'static str` (see below). It is not possible to move out of borrowed strings because they are
18+
//! owned elsewhere.
2019
//!
2120
//! # Examples
2221
//!
@@ -26,9 +25,8 @@
2625
//! let s = "Hello, world.";
2726
//! ```
2827
//!
29-
//! This `&str` is a `&'static str`, which is the type of string literals.
30-
//! They're `'static` because literals are available for the entire lifetime of
31-
//! the program.
28+
//! This `&str` is a `&'static str`, which is the type of string literals. They're `'static`
29+
//! because literals are available for the entire lifetime of the program.
3230
//!
3331
//! You can get a non-`'static` `&str` by taking a slice of a `String`:
3432
//!
@@ -39,13 +37,12 @@
3937
//!
4038
//! # Representation
4139
//!
42-
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as
43-
//! a stream of UTF-8 bytes. All [strings](../../reference.html#literals) are
44-
//! guaranteed to be validly encoded UTF-8 sequences. Additionally, strings are
45-
//! not null-terminated and can thus contain null bytes.
40+
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as a stream of UTF-8
41+
//! bytes. All [strings](../../reference.html#literals) are guaranteed to be validly encoded UTF-8
42+
//! sequences. Additionally, strings are not null-terminated and can thus contain null bytes.
4643
//!
47-
//! The actual representation of `str`s have direct mappings to slices: `&str`
48-
//! is the same as `&[u8]`.
44+
//! The actual representation of `str`s have direct mappings to slices: `&str` is the same as
45+
//! `&[u8]`.
4946
5047
#![doc(primitive = "str")]
5148
#![stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)