diff options
| author | Alex Burka <durka42+github@gmail.com> | 2018-04-03 09:11:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-03 09:11:41 -0400 |
| commit | 93a3e93bf3015df01f9759ab4ca4fd7a6932d8a1 (patch) | |
| tree | 9616d9346d9bbdb5a855d3e25ee37d17a0668ffd /src/libcore/fmt | |
| parent | b12af86a776364f01f65e3bd551e2641b4fac4ec (diff) | |
| download | rust-93a3e93bf3015df01f9759ab4ca4fd7a6932d8a1.tar.gz rust-93a3e93bf3015df01f9759ab4ca4fd7a6932d8a1.zip | |
tweak fmt::Arguments docs
Remove an outdated claim about passing something or other to a function. Also swap the variable names in the example.
Diffstat (limited to 'src/libcore/fmt')
| -rw-r--r-- | src/libcore/fmt/mod.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 62994ed15cc..d55219d7226 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -401,10 +401,9 @@ impl<'a> Arguments<'a> { /// safely be done, so no constructors are given and the fields are private /// to prevent modification. /// -/// The [`format_args!`] macro will safely create an instance of this structure -/// and pass it to a function or closure, passed as the first argument. The -/// macro validates the format string at compile-time so usage of the [`write`] -/// and [`format`] functions can be safely performed. +/// The [`format_args!`] macro will safely create an instance of this structure. +/// The macro validates the format string at compile-time so usage of the +/// [`write`] and [`format`] functions can be safely performed. /// /// You can use the `Arguments<'a>` that [`format_args!`] returns in `Debug` /// and `Display` contexts as seen below. The example also shows that `Debug` @@ -412,8 +411,8 @@ impl<'a> Arguments<'a> { /// in `format_args!`. /// /// ```rust -/// let display = format!("{:?}", format_args!("{} foo {:?}", 1, 2)); -/// let debug = format!("{}", format_args!("{} foo {:?}", 1, 2)); +/// let debug = format!("{:?}", format_args!("{} foo {:?}", 1, 2)); +/// let display = format!("{}", format_args!("{} foo {:?}", 1, 2)); /// assert_eq!("1 foo 2", display); /// assert_eq!(display, debug); /// ``` |
