Skip to content

Fixup primitive.str docs #23901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
//
// ignore-lexer-test FIXME #15679

//! Unicode string manipulation (the [`str`](../primitive.str.html) type).
//! Unicode string manipulation (the `str` type).
//!
//! Rust's [`str`](../primitive.str.html) type is one of the core primitive
//! types of the language. `&str` is the borrowed string type. This type of
//! string can only be created from other strings, unless it is a `&'static str`
//! (see below). It is not possible to move out of borrowed strings because they
//! are owned elsewhere.
//! Rust's `str` type is one of the core primitive types of the language. `&str` is the borrowed
//! string type. This type of string can only be created from other strings, unless it is a
//! `&'static str` (see below). It is not possible to move out of borrowed strings because they are
//! owned elsewhere.
//!
//! # Examples
//!
Expand All @@ -26,9 +25,8 @@
//! let s = "Hello, world.";
//! ```
//!
//! This `&str` is a `&'static str`, which is the type of string literals.
//! They're `'static` because literals are available for the entire lifetime of
//! the program.
//! This `&str` is a `&'static str`, which is the type of string literals. They're `'static`
//! because literals are available for the entire lifetime of the program.
//!
//! You can get a non-`'static` `&str` by taking a slice of a `String`:
//!
Expand All @@ -39,13 +37,12 @@
//!
//! # Representation
//!
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as
//! a stream of UTF-8 bytes. All [strings](../../reference.html#literals) are
//! guaranteed to be validly encoded UTF-8 sequences. Additionally, strings are
//! not null-terminated and can thus contain null bytes.
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as a stream of UTF-8
//! bytes. All [strings](../../reference.html#literals) are guaranteed to be validly encoded UTF-8
//! sequences. Additionally, strings are not null-terminated and can thus contain null bytes.
//!
//! The actual representation of `str`s have direct mappings to slices: `&str`
//! is the same as `&[u8]`.
//! The actual representation of `str`s have direct mappings to slices: `&str` is the same as
//! `&[u8]`.

#![doc(primitive = "str")]
#![stable(feature = "rust1", since = "1.0.0")]
Expand Down