Address feedback

This commit is contained in:
Brian Anderson 2015-07-13 17:56:31 -07:00
parent 4089ba873e
commit 3a180d15f8
3 changed files with 41 additions and 32 deletions

View File

@ -951,3 +951,8 @@
}()); }());
}()); }());
// Sets the focus on the search bar at the top of the page
function focusSearchBar() {
document.getElementsByName('search')[0].focus();
}

View File

@ -14,7 +14,7 @@
//! software, a set of minimal and battle-tested shared abstractions //! software, a set of minimal and battle-tested shared abstractions
//! for the [broader Rust ecosystem](https://crates.io). It offers //! for the [broader Rust ecosystem](https://crates.io). It offers
//! core types (e.g. [`Vec`](vec/index.html) //! core types (e.g. [`Vec`](vec/index.html)
//! and[`Option`](option/index.html)), library-defined [operations on //! and [`Option`](option/index.html)), library-defined [operations on
//! language primitives](#primitive) (e.g. [`u32`](u32/index.html) and //! language primitives](#primitive) (e.g. [`u32`](u32/index.html) and
//! [`str`](str/index.html)), [standard macros](#macros), //! [`str`](str/index.html)), [standard macros](#macros),
//! [I/O](io/index.html) and [multithreading](thread/index.html), among //! [I/O](io/index.html) and [multithreading](thread/index.html), among
@ -32,17 +32,11 @@
//! [book-crate-root]: ../book/crates-and-modules.html#basic-terminology:-crates-and-modules //! [book-crate-root]: ../book/crates-and-modules.html#basic-terminology:-crates-and-modules
//! [book-use]: ../book/crates-and-modules.html#importing-modules-with-use //! [book-use]: ../book/crates-and-modules.html#importing-modules-with-use
//! //!
//! Furthermore, the standard library defines [The Rust
//! Prelude](prelude/index.html), a small collection of items, mostly
//! traits, that are imported into every module and through trait
//! resolution provide Rust with much of its *standard flavor*.
//!
//! # How to read this documentation //! # How to read this documentation
//! //!
//! If you already know the name of what you are looking for the //! If you already know the name of what you are looking for the
//! fastest way to find it is to use the <a href="#" //! fastest way to find it is to use the <a href="#"
//! onclick="document.getElementsByName('search')[0].focus();">search //! onclick="focusSearchBar();">search bar</a> at the top of the page.
//! bar</a> at the top of the page.
//! //!
//! Otherwise, you may want to jump to one of these useful sections: //! Otherwise, you may want to jump to one of these useful sections:
//! //!
@ -52,10 +46,10 @@
//! * [The Rust Prelude](prelude/index.html) //! * [The Rust Prelude](prelude/index.html)
//! //!
//! If this is your first time, the documentation for the standard //! If this is your first time, the documentation for the standard
//! library is written to be casually perused and clicking on //! library is written to be casually perused. Clicking on interesting
//! interesting things should generally lead you to interesting //! things should generally lead you to interesting places. Still,
//! places. Still, there are important bits you don't want to miss, so //! there are important bits you don't want to miss, so read on for a
//! read on for a tour of the standard library and its documentation. //! tour of the standard library and its documentation!
//! //!
//! Once you are familiar with the contents of the standard library //! Once you are familiar with the contents of the standard library
//! you may begin to find the verbosity of the prose distracting. At //! you may begin to find the verbosity of the prose distracting. At
@ -81,7 +75,7 @@
//! includes an overview of the module along with examples, and are //! includes an overview of the module along with examples, and are
//! a smart place to start familiarizing yourself with the library. //! a smart place to start familiarizing yourself with the library.
//! //!
//! Secondly, implicit methods on [primitive //! Second, implicit methods on [primitive
//! types](../book/primitive-types.html) are documented here. This can //! types](../book/primitive-types.html) are documented here. This can
//! be a source of confusion for two reasons: //! be a source of confusion for two reasons:
//! //!
@ -109,17 +103,17 @@
//! primitive types are documented on their own pages will bring you a //! primitive types are documented on their own pages will bring you a
//! deep inner wisdom. Embrace it now before proceeding.* //! deep inner wisdom. Embrace it now before proceeding.*
//! //!
//! Thirdly, the standard library defines [The Rust //! Third, the standard library defines [The Rust
//! Prelude](prelude/index.html), a small collection of items - mostly //! Prelude](prelude/index.html), a small collection of items - mostly
//! traits - that are imported into every module. The traits in the //! traits - that are imported into every module of every crate. The
//! prelude are pervasive, making the prelude documentation a good //! traits in the prelude are pervasive, making the prelude
//! entry point to learning about the library. //! documentation a good entry point to learning about the library.
//! //!
//! And lastly, the standard library exports a number of standard //! And finally, the standard library exports a number of standard
//! macros, and [lists them on this page](#macros) (technically, not //! macros, and [lists them on this page](#macros) (technically, not
//! all of the standard macros are defined by the standard library - //! all of the standard macros are defined by the standard library -
//! some are defined by the compiler - but they are documented here //! some are defined by the compiler - but they are documented here
//! the same). Like the prelude, the standard macros are imported by //! the same). Like the prelude, the standard macros are imported by
//! default into all crates. //! default into all crates.
//! //!
//! # A Tour of The Rust Standard Library //! # A Tour of The Rust Standard Library
@ -136,18 +130,28 @@
//! [`Iterator`](iter/trait.Iterator.html), which works with the `for` //! [`Iterator`](iter/trait.Iterator.html), which works with the `for`
//! loop to access collections. //! loop to access collections.
//! //!
//! The common container type, `Vec`, a growable vector backed by an //! The standard library exposes 3 common ways to deal with contiguous
//! array, lives in the [`vec`](vec/index.html) module. Contiguous, //! regions of memory:
//! unsized regions of memory, `[T]`, commonly called "slices", and //!
//! their borrowed versions, `&[T]`, commonly called "borrowed //! * [`Vec<T>`](vec/index.html) - A heap-allocated *vector* that is
//! slices", are primitive types [with many implicit //! resizable at runtime.
//! methods](primitive.slice.html) defined by the standard library. //! * [`[T; n]`](primitive.array.html) - An inline *array* with a
//! fixed size at compile time.
//! * [`[T]`](primitive.slice.html) - A dynamically sized *slice* into
//! any other kind of contiguous storage, whether heap-allocated or
//! not.
//! //!
//! `str`, a UTF-8 string, is a primitive type, and the standard //! Slices can only be handled through some kind of *pointer*, and as
//! library defines [many methods for it](primitive.str.html). //! such come in many flavours such as:
//! Rust `str`s are immutable; use the owned `String` type //!
//! defined in [`string`](string/index.html) for building and mutating //! * `&[T]` - *shared slice*
//! strings. //! * `&mut [T]` - *mutable slice*
//! * [`Box<[T]>`](boxed/index.html) - *owned slice*
//!
//! `str`, a UTF-8 string slice, is a primitive type, and the standard
//! library defines [many methods for it](primitive.str.html). Rust
//! `str`s are immutable; use the owned `String` type defined in
//! [`string`](string/index.html) for building and mutating strings.
//! //!
//! For converting to strings use the [`format!`](fmt/index.html) //! For converting to strings use the [`format!`](fmt/index.html)
//! macro, and for converting from strings use the //! macro, and for converting from strings use the

View File

@ -34,9 +34,9 @@
//! ``` //! ```
//! //!
//! The prelude is primarily concerned with exporting *traits* that //! The prelude is primarily concerned with exporting *traits* that
//! are so pervasive that it would be onerous to import for every use, //! are so pervasive that they would be onerous to import for every use,
//! particularly those that are commonly mentioned in [generic type //! particularly those that are commonly mentioned in [generic type
//! bounds][book-traits], and that are often used //! bounds][book-traits].
//! //!
//! The current version of the prelude (version 1) lives in //! The current version of the prelude (version 1) lives in
//! [`std::prelude::v1`](v1/index.html), and reexports the following. //! [`std::prelude::v1`](v1/index.html), and reexports the following.