]> git.lizzy.rs Git - rust.git/commitdiff
tweak format_args! docs
authorAlex Burka <durka42+github@gmail.com>
Tue, 3 Apr 2018 13:20:04 +0000 (09:20 -0400)
committerGitHub <noreply@github.com>
Tue, 3 Apr 2018 13:20:04 +0000 (09:20 -0400)
Swap the variable names in the example.

src/libstd/macros.rs

index 47609f17221ef5dd9ce17cb07dfaf9e2b4dc2c4a..5ef7c15965505df76be13fe25edf6f41eb2af87e 100644 (file)
@@ -341,8 +341,8 @@ macro_rules! compile_error {
     /// format string 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);
     /// ```