]> git.lizzy.rs Git - rust.git/commitdiff
tweak fmt::Arguments docs
authorAlex Burka <durka42+github@gmail.com>
Tue, 3 Apr 2018 13:11:41 +0000 (09:11 -0400)
committerGitHub <noreply@github.com>
Tue, 3 Apr 2018 13:11:41 +0000 (09:11 -0400)
Remove an outdated claim about passing something or other to a function. Also swap the variable names in the example.

src/libcore/fmt/mod.rs

index 62994ed15cc6daf708350cf146a249927d1b9ce5..d55219d7226e6d5fda7e7679df06994ab6a987f8 100644 (file)
@@ -401,10 +401,9 @@ pub fn estimated_capacity(&self) -> usize {
 /// 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 @@ pub fn estimated_capacity(&self) -> usize {
 /// 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);
 /// ```