about summary refs log tree commit diff
path: root/src/libcore/fmt
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-19 19:41:20 +0100
committerGitHub <noreply@github.com>2019-01-19 19:41:20 +0100
commit286ce3c36a408093208659e8b1777d06385d4e2e (patch)
tree6df46634232786dc2b31175bf4a7b2b3b8cf4fa7 /src/libcore/fmt
parent93234994b85114e3248a216142eaab20c5e2f09e (diff)
parent5fc6fc3d90b32c504b3ffe1802e48987cb7a7e64 (diff)
downloadrust-286ce3c36a408093208659e8b1777d06385d4e2e.tar.gz
rust-286ce3c36a408093208659e8b1777d06385d4e2e.zip
Rollup merge of #57452 - steveklabnik:improve-formatter-docs, r=frewsxcv
Improve docs for Formatter

Some improvements to `std::fmt::Formatter` to make it a bit more consistent with other documentation, as well as calling out that you don't ever instantiate one yourself.
Diffstat (limited to 'src/libcore/fmt')
-rw-r--r--src/libcore/fmt/mod.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index 214b5d3a84f..5221d6f17c2 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -211,9 +211,18 @@ impl<W: Write + ?Sized> Write for &mut W {
     }
 }
 
-/// A struct to represent both where to emit formatting strings to and how they
-/// should be formatted. A mutable version of this is passed to all formatting
-/// traits.
+/// Configuration for formatting.
+///
+/// A `Formatter` represents various options related to formatting. Users do not
+/// construct `Formatter`s directly; a mutable reference to one is passed to
+/// the `fmt` method of all formatting traits, like [`Debug`] and [`Display`].
+///
+/// To interact with a `Formatter`, you'll call various methods to change the
+/// various options related to formatting. For examples, please see the
+/// documentation of the methods defined on `Formatter` below.
+///
+/// [`Debug`]: trait.Debug.html
+/// [`Display`]: trait.Display.html
 #[allow(missing_debug_implementations)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Formatter<'a> {