From c78bfbae286174f3a07b0d0c77b702845a691931 Mon Sep 17 00:00:00 2001 From: Camelid Date: Fri, 18 Dec 2020 14:58:10 -0800 Subject: [PATCH 1/4] Use consistent punctuation for 'Prelude contents' docs --- library/std/src/prelude/mod.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/library/std/src/prelude/mod.rs b/library/std/src/prelude/mod.rs index a3776681d0349..a83c280adcb2d 100644 --- a/library/std/src/prelude/mod.rs +++ b/library/std/src/prelude/mod.rs @@ -28,35 +28,35 @@ //! The current version of the prelude (version 1) lives in //! [`std::prelude::v1`], and re-exports the following: //! -//! * [`std::marker`]::{[`Copy`], [`Send`], [`Sized`], [`Sync`], [`Unpin`]}, -//! marker traits that indicate fundamental properties of types. -//! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}, various +//! * [`std::marker`]::{[`Copy`], [`Send`], [`Sized`], [`Sync`], [`Unpin`]}: +//! Marker traits that indicate fundamental properties of types. +//! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}: Various //! operations for both destructors and overloading `()`. -//! * [`std::mem`]::[`drop`][`mem::drop`], a convenience function for explicitly +//! * [`std::mem`]::[`drop`][`mem::drop`]: A convenience function for explicitly //! dropping a value. -//! * [`std::boxed`]::[`Box`], a way to allocate values on the heap. -//! * [`std::borrow`]::[`ToOwned`], the conversion trait that defines +//! * [`std::boxed`]::[`Box`]: A way to allocate values on the heap. +//! * [`std::borrow`]::[`ToOwned`]: The conversion trait that defines //! [`to_owned`], the generic method for creating an owned type from a //! borrowed type. -//! * [`std::clone`]::[`Clone`], the ubiquitous trait that defines +//! * [`std::clone`]::[`Clone`]: The ubiquitous trait that defines //! [`clone`][`Clone::clone`], the method for producing a copy of a value. -//! * [`std::cmp`]::{[`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`] }, the +//! * [`std::cmp`]::{[`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]}: The //! comparison traits, which implement the comparison operators and are often //! seen in trait bounds. -//! * [`std::convert`]::{[`AsRef`], [`AsMut`], [`Into`], [`From`]}, generic +//! * [`std::convert`]::{[`AsRef`], [`AsMut`], [`Into`], [`From`]}: Generic //! conversions, used by savvy API authors to create overloaded methods. //! * [`std::default`]::[`Default`], types that have default values. -//! * [`std::iter`]::{[`Iterator`], [`Extend`], [`IntoIterator`] -//! [`DoubleEndedIterator`], [`ExactSizeIterator`]}, iterators of various +//! * [`std::iter`]::{[`Iterator`], [`Extend`], [`IntoIterator`], +//! [`DoubleEndedIterator`], [`ExactSizeIterator`]}: Iterators of various //! kinds. //! * [`std::option`]::[`Option`]::{[`self`][`Option`], [`Some`], [`None`]}, a //! type which expresses the presence or absence of a value. This type is so //! commonly used, its variants are also exported. -//! * [`std::result`]::[`Result`]::{[`self`][`Result`], [`Ok`], [`Err`]}, a type +//! * [`std::result`]::[`Result`]::{[`self`][`Result`], [`Ok`], [`Err`]}: A type //! for functions that may succeed or fail. Like [`Option`], its variants are //! exported as well. -//! * [`std::string`]::{[`String`], [`ToString`]}, heap allocated strings. -//! * [`std::vec`]::[`Vec`], a growable, heap-allocated vector. +//! * [`std::string`]::{[`String`], [`ToString`]}: Heap-allocated strings. +//! * [`std::vec`]::[`Vec`]: A growable, heap-allocated vector. //! //! [`mem::drop`]: crate::mem::drop //! [`std::borrow`]: crate::borrow From 4a6014bc289abd2573a4362915cbf026912f209d Mon Sep 17 00:00:00 2001 From: Camelid Date: Fri, 18 Dec 2020 15:00:09 -0800 Subject: [PATCH 2/4] Use heading style for 'The I/O Prelude' in `std::io::prelude` --- library/std/src/io/prelude.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/io/prelude.rs b/library/std/src/io/prelude.rs index 3baab2be37795..700f166daf77d 100644 --- a/library/std/src/io/prelude.rs +++ b/library/std/src/io/prelude.rs @@ -1,4 +1,4 @@ -//! The I/O Prelude +//! # The I/O Prelude //! //! The purpose of this module is to alleviate imports of many common I/O traits //! by adding a glob import to the top of I/O heavy modules: From 4274ba40bda3af26042d44557da9d2cdb1567880 Mon Sep 17 00:00:00 2001 From: Camelid Date: Tue, 5 Jan 2021 17:51:27 -0800 Subject: [PATCH 3/4] Use lowercase for prelude items --- library/std/src/prelude/mod.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/library/std/src/prelude/mod.rs b/library/std/src/prelude/mod.rs index a83c280adcb2d..08f3ff5f253c5 100644 --- a/library/std/src/prelude/mod.rs +++ b/library/std/src/prelude/mod.rs @@ -29,34 +29,34 @@ //! [`std::prelude::v1`], and re-exports the following: //! //! * [`std::marker`]::{[`Copy`], [`Send`], [`Sized`], [`Sync`], [`Unpin`]}: -//! Marker traits that indicate fundamental properties of types. -//! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}: Various +//! marker traits that indicate fundamental properties of types. +//! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}: various //! operations for both destructors and overloading `()`. -//! * [`std::mem`]::[`drop`][`mem::drop`]: A convenience function for explicitly +//! * [`std::mem`]::[`drop`][`mem::drop`]: a convenience function for explicitly //! dropping a value. -//! * [`std::boxed`]::[`Box`]: A way to allocate values on the heap. -//! * [`std::borrow`]::[`ToOwned`]: The conversion trait that defines +//! * [`std::boxed`]::[`Box`]: a way to allocate values on the heap. +//! * [`std::borrow`]::[`ToOwned`]: the conversion trait that defines //! [`to_owned`], the generic method for creating an owned type from a //! borrowed type. -//! * [`std::clone`]::[`Clone`]: The ubiquitous trait that defines +//! * [`std::clone`]::[`Clone`]: the ubiquitous trait that defines //! [`clone`][`Clone::clone`], the method for producing a copy of a value. -//! * [`std::cmp`]::{[`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]}: The +//! * [`std::cmp`]::{[`PartialEq`], [`PartialOrd`], [`Eq`], [`Ord`]}: the //! comparison traits, which implement the comparison operators and are often //! seen in trait bounds. -//! * [`std::convert`]::{[`AsRef`], [`AsMut`], [`Into`], [`From`]}: Generic +//! * [`std::convert`]::{[`AsRef`], [`AsMut`], [`Into`], [`From`]}: generic //! conversions, used by savvy API authors to create overloaded methods. //! * [`std::default`]::[`Default`], types that have default values. //! * [`std::iter`]::{[`Iterator`], [`Extend`], [`IntoIterator`], -//! [`DoubleEndedIterator`], [`ExactSizeIterator`]}: Iterators of various +//! [`DoubleEndedIterator`], [`ExactSizeIterator`]}: iterators of various //! kinds. //! * [`std::option`]::[`Option`]::{[`self`][`Option`], [`Some`], [`None`]}, a //! type which expresses the presence or absence of a value. This type is so //! commonly used, its variants are also exported. -//! * [`std::result`]::[`Result`]::{[`self`][`Result`], [`Ok`], [`Err`]}: A type +//! * [`std::result`]::[`Result`]::{[`self`][`Result`], [`Ok`], [`Err`]}: a type //! for functions that may succeed or fail. Like [`Option`], its variants are //! exported as well. -//! * [`std::string`]::{[`String`], [`ToString`]}: Heap-allocated strings. -//! * [`std::vec`]::[`Vec`]: A growable, heap-allocated vector. +//! * [`std::string`]::{[`String`], [`ToString`]}: heap-allocated strings. +//! * [`std::vec`]::[`Vec`]: a growable, heap-allocated vector. //! //! [`mem::drop`]: crate::mem::drop //! [`std::borrow`]: crate::borrow From 25a49641911c21fa3cc7071b507923e6214b71c3 Mon Sep 17 00:00:00 2001 From: Camelid Date: Tue, 5 Jan 2021 17:52:24 -0800 Subject: [PATCH 4/4] Use heading for `std::prelude` and not `io::prelude` The heading style for `std::prelude` is to be consistent with the headings for `std` and `core`: `# The Rust Standard Library` and `# The Rust Core Library`, respectively. --- library/std/src/io/prelude.rs | 2 +- library/std/src/prelude/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/io/prelude.rs b/library/std/src/io/prelude.rs index 700f166daf77d..d80643101f2ed 100644 --- a/library/std/src/io/prelude.rs +++ b/library/std/src/io/prelude.rs @@ -1,4 +1,4 @@ -//! # The I/O Prelude +//! The I/O Prelude. //! //! The purpose of this module is to alleviate imports of many common I/O traits //! by adding a glob import to the top of I/O heavy modules: diff --git a/library/std/src/prelude/mod.rs b/library/std/src/prelude/mod.rs index 08f3ff5f253c5..eb2095b819657 100644 --- a/library/std/src/prelude/mod.rs +++ b/library/std/src/prelude/mod.rs @@ -1,4 +1,4 @@ -//! The Rust Prelude. +//! # The Rust Prelude //! //! Rust comes with a variety of things in its standard library. However, if //! you had to manually import every single thing that you used, it would be