Skip to content

Commit 14a7f4d

Browse files
author
Knight
committed
Fix #35031
1 parent 9316ae5 commit 14a7f4d

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/libcollections/fmt.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -434,37 +434,31 @@
434434
//! in this case, if one uses the format string `{<arg>:<spec>.*}`, then the `<arg>` part refers
435435
//! to the *value* to print, and the `precision` must come in the input preceding `<arg>`.
436436
//!
437-
//! For example, these:
437+
//! For example, the following calls all print the same thing `Hello x is 0.01000`:
438438
//!
439439
//! ```
440-
//! // Hello {arg 0 (x)} is {arg 1 (0.01) with precision specified inline (5)}
440+
//! // Hello {arg 0 ("x")} is {arg 1 (0.01) with precision specified inline (5)}
441441
//! println!("Hello {0} is {1:.5}", "x", 0.01);
442442
//!
443-
//! // Hello {arg 1 (x)} is {arg 2 (0.01) with precision specified in arg 0 (5)}
443+
//! // Hello {arg 1 ("x")} is {arg 2 (0.01) with precision specified in arg 0 (5)}
444444
//! println!("Hello {1} is {2:.0$}", 5, "x", 0.01);
445445
//!
446-
//! // Hello {arg 0 (x)} is {arg 2 (0.01) with precision specified in arg 1 (5)}
446+
//! // Hello {arg 0 ("x")} is {arg 2 (0.01) with precision specified in arg 1 (5)}
447447
//! println!("Hello {0} is {2:.1$}", "x", 5, 0.01);
448448
//!
449-
//! // Hello {next arg (x)} is {second of next two args (0.01) with precision
449+
//! // Hello {next arg ("x")} is {second of next two args (0.01) with precision
450450
//! // specified in first of next two args (5)}
451451
//! println!("Hello {} is {:.*}", "x", 5, 0.01);
452452
//!
453-
//! // Hello {next arg (x)} is {arg 2 (0.01) with precision
453+
//! // Hello {next arg ("x")} is {arg 2 (0.01) with precision
454454
//! // specified in its predecessor (5)}
455455
//! println!("Hello {} is {2:.*}", "x", 5, 0.01);
456456
//!
457-
//! // Hello {next arg (x)} is {arg "number" (0.01) with precision specified
457+
//! // Hello {next arg ("x")} is {arg "number" (0.01) with precision specified
458458
//! // in arg "prec" (5)}
459459
//! println!("Hello {} is {number:.prec$}", "x", prec = 5, number = 0.01);
460460
//! ```
461461
//!
462-
//! All print the same thing:
463-
//!
464-
//! ```text
465-
//! Hello x is 0.01000
466-
//! ```
467-
//!
468462
//! While these:
469463
//!
470464
//! ```

0 commit comments

Comments
 (0)