Skip to content

Commit 39c642e

Browse files
ijacksonRalfJung
authored andcommitted
format, format_args: Make xref to std::fmt much more prominent
That xref contains the actual documentation for what format! does. It should be very prominent - particularly, more so than the other links.
1 parent 2ec8b6b commit 39c642e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

library/alloc/src/macros.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ macro_rules! vec {
7979
///
8080
/// The first argument `format!` receives is a format string. This must be a string
8181
/// literal. The power of the formatting string is in the `{}`s contained.
82-
///
8382
/// Additional parameters passed to `format!` replace the `{}`s within the
8483
/// formatting string in the order given unless named or positional parameters
85-
/// are used; see [`std::fmt`] for more information.
84+
/// are used.
85+
///
86+
/// See [the formatting syntax documentation in `std::fmt`](../std/fmt/index.html)
87+
/// for details.
8688
///
8789
/// A common use for `format!` is concatenation and interpolation of strings.
8890
/// The same convention is used with [`print!`] and [`write!`] macros,
@@ -91,7 +93,6 @@ macro_rules! vec {
9193
/// To convert a single value to a string, use the [`to_string`] method. This
9294
/// will use the [`Display`] formatting trait.
9395
///
94-
/// [`std::fmt`]: ../std/fmt/index.html
9596
/// [`print!`]: ../std/macro.print.html
9697
/// [`write!`]: core::write
9798
/// [`to_string`]: crate::string::ToString

library/core/src/macros/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,8 @@ pub(crate) mod builtin {
849849
/// assert_eq!(display, debug);
850850
/// ```
851851
///
852-
/// For more information, see the documentation in [`std::fmt`].
852+
/// See [the formatting documentation in `std::fmt`](../std/fmt/index.html)
853+
/// for details of the macro argument syntax, and further information.
853854
///
854855
/// [`Display`]: crate::fmt::Display
855856
/// [`Debug`]: crate::fmt::Debug

0 commit comments

Comments
 (0)