Skip to content

Commit 0d5023d

Browse files
steveklabnikVardhan Thigle
authored andcommitted
Improve docs for Formatter
1 parent 6a47ada commit 0d5023d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/libcore/fmt/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,18 @@ impl<W: Write + ?Sized> Write for &mut W {
211211
}
212212
}
213213

214-
/// A struct to represent both where to emit formatting strings to and how they
215-
/// should be formatted. A mutable version of this is passed to all formatting
216-
/// traits.
214+
/// Configuration for formatting.
215+
///
216+
/// A `Formatter` represents various options related to formatting. Users do not
217+
/// construct `Formatter`s directly; a mutable reference to one is passed to
218+
/// the `fmt` method of all formatting traits, like [`Debug`] and [`Display`].
219+
///
220+
/// To interact with a `Formatter`, you'll call various methods to change the
221+
/// various options related to formatting. For examples, please see the
222+
/// documentation of the methods defined on `Formatter` below.
223+
///
224+
/// [`Debug`]: trait.Debug.html
225+
/// [`Display`]: trait.Display.html
217226
#[allow(missing_debug_implementations)]
218227
#[stable(feature = "rust1", since = "1.0.0")]
219228
pub struct Formatter<'a> {

0 commit comments

Comments
 (0)