Skip to content

Commit 3a180d1

Browse files
committed
Address feedback
1 parent 4089ba8 commit 3a180d1

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

src/librustdoc/html/static/main.js

+5
Original file line numberDiff line numberDiff line change
@@ -951,3 +951,8 @@
951951
}());
952952

953953
}());
954+
955+
// Sets the focus on the search bar at the top of the page
956+
function focusSearchBar() {
957+
document.getElementsByName('search')[0].focus();
958+
}

src/libstd/lib.rs

+35-31
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! software, a set of minimal and battle-tested shared abstractions
1515
//! for the [broader Rust ecosystem](https://crates.io). It offers
1616
//! core types (e.g. [`Vec`](vec/index.html)
17-
//! and[`Option`](option/index.html)), library-defined [operations on
17+
//! and [`Option`](option/index.html)), library-defined [operations on
1818
//! language primitives](#primitive) (e.g. [`u32`](u32/index.html) and
1919
//! [`str`](str/index.html)), [standard macros](#macros),
2020
//! [I/O](io/index.html) and [multithreading](thread/index.html), among
@@ -32,17 +32,11 @@
3232
//! [book-crate-root]: ../book/crates-and-modules.html#basic-terminology:-crates-and-modules
3333
//! [book-use]: ../book/crates-and-modules.html#importing-modules-with-use
3434
//!
35-
//! Furthermore, the standard library defines [The Rust
36-
//! Prelude](prelude/index.html), a small collection of items, mostly
37-
//! traits, that are imported into every module and through trait
38-
//! resolution provide Rust with much of its *standard flavor*.
39-
//!
4035
//! # How to read this documentation
4136
//!
4237
//! If you already know the name of what you are looking for the
4338
//! fastest way to find it is to use the <a href="#"
44-
//! onclick="document.getElementsByName('search')[0].focus();">search
45-
//! bar</a> at the top of the page.
39+
//! onclick="focusSearchBar();">search bar</a> at the top of the page.
4640
//!
4741
//! Otherwise, you may want to jump to one of these useful sections:
4842
//!
@@ -52,10 +46,10 @@
5246
//! * [The Rust Prelude](prelude/index.html)
5347
//!
5448
//! If this is your first time, the documentation for the standard
55-
//! library is written to be casually perused and clicking on
56-
//! interesting things should generally lead you to interesting
57-
//! places. Still, there are important bits you don't want to miss, so
58-
//! read on for a tour of the standard library and its documentation.
49+
//! library is written to be casually perused. Clicking on interesting
50+
//! things should generally lead you to interesting places. Still,
51+
//! there are important bits you don't want to miss, so read on for a
52+
//! tour of the standard library and its documentation!
5953
//!
6054
//! Once you are familiar with the contents of the standard library
6155
//! you may begin to find the verbosity of the prose distracting. At
@@ -81,7 +75,7 @@
8175
//! includes an overview of the module along with examples, and are
8276
//! a smart place to start familiarizing yourself with the library.
8377
//!
84-
//! Secondly, implicit methods on [primitive
78+
//! Second, implicit methods on [primitive
8579
//! types](../book/primitive-types.html) are documented here. This can
8680
//! be a source of confusion for two reasons:
8781
//!
@@ -109,17 +103,17 @@
109103
//! primitive types are documented on their own pages will bring you a
110104
//! deep inner wisdom. Embrace it now before proceeding.*
111105
//!
112-
//! Thirdly, the standard library defines [The Rust
106+
//! Third, the standard library defines [The Rust
113107
//! Prelude](prelude/index.html), a small collection of items - mostly
114-
//! traits - that are imported into every module. The traits in the
115-
//! prelude are pervasive, making the prelude documentation a good
116-
//! entry point to learning about the library.
108+
//! traits - that are imported into every module of every crate. The
109+
//! traits in the prelude are pervasive, making the prelude
110+
//! documentation a good entry point to learning about the library.
117111
//!
118-
//! And lastly, the standard library exports a number of standard
112+
//! And finally, the standard library exports a number of standard
119113
//! macros, and [lists them on this page](#macros) (technically, not
120114
//! all of the standard macros are defined by the standard library -
121115
//! some are defined by the compiler - but they are documented here
122-
//! the same). Like the prelude, the standard macros are imported by
116+
//! the same). Like the prelude, the standard macros are imported by
123117
//! default into all crates.
124118
//!
125119
//! # A Tour of The Rust Standard Library
@@ -136,18 +130,28 @@
136130
//! [`Iterator`](iter/trait.Iterator.html), which works with the `for`
137131
//! loop to access collections.
138132
//!
139-
//! The common container type, `Vec`, a growable vector backed by an
140-
//! array, lives in the [`vec`](vec/index.html) module. Contiguous,
141-
//! unsized regions of memory, `[T]`, commonly called "slices", and
142-
//! their borrowed versions, `&[T]`, commonly called "borrowed
143-
//! slices", are primitive types [with many implicit
144-
//! methods](primitive.slice.html) defined by the standard library.
145-
//!
146-
//! `str`, a UTF-8 string, is a primitive type, and the standard
147-
//! library defines [many methods for it](primitive.str.html).
148-
//! Rust `str`s are immutable; use the owned `String` type
149-
//! defined in [`string`](string/index.html) for building and mutating
150-
//! strings.
133+
//! The standard library exposes 3 common ways to deal with contiguous
134+
//! regions of memory:
135+
//!
136+
//! * [`Vec<T>`](vec/index.html) - A heap-allocated *vector* that is
137+
//! resizable at runtime.
138+
//! * [`[T; n]`](primitive.array.html) - An inline *array* with a
139+
//! fixed size at compile time.
140+
//! * [`[T]`](primitive.slice.html) - A dynamically sized *slice* into
141+
//! any other kind of contiguous storage, whether heap-allocated or
142+
//! not.
143+
//!
144+
//! Slices can only be handled through some kind of *pointer*, and as
145+
//! such come in many flavours such as:
146+
//!
147+
//! * `&[T]` - *shared slice*
148+
//! * `&mut [T]` - *mutable slice*
149+
//! * [`Box<[T]>`](boxed/index.html) - *owned slice*
150+
//!
151+
//! `str`, a UTF-8 string slice, is a primitive type, and the standard
152+
//! library defines [many methods for it](primitive.str.html). Rust
153+
//! `str`s are immutable; use the owned `String` type defined in
154+
//! [`string`](string/index.html) for building and mutating strings.
151155
//!
152156
//! For converting to strings use the [`format!`](fmt/index.html)
153157
//! macro, and for converting from strings use the

src/libstd/prelude/mod.rs

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

0 commit comments

Comments
 (0)