diff options
| author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-04-28 14:27:57 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-08-28 11:54:40 +0200 |
| commit | 39c642e3d2c5f5d5e6e6b65ccd01439ef736c277 (patch) | |
| tree | f897921eb2e44d64a1acac3e42dbc59ba8a05345 | |
| parent | 2ec8b6b50fddf481f3ed11201a142f09481a81c6 (diff) | |
| download | rust-39c642e3d2c5f5d5e6e6b65ccd01439ef736c277.tar.gz rust-39c642e3d2c5f5d5e6e6b65ccd01439ef736c277.zip | |
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.
| -rw-r--r-- | library/alloc/src/macros.rs | 7 | ||||
| -rw-r--r-- | library/core/src/macros/mod.rs | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index 4c6ae8f2579..3f19561e1ac 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -79,10 +79,12 @@ macro_rules! vec { /// /// The first argument `format!` receives is a format string. This must be a string /// literal. The power of the formatting string is in the `{}`s contained. -/// /// Additional parameters passed to `format!` replace the `{}`s within the /// formatting string in the order given unless named or positional parameters -/// are used; see [`std::fmt`] for more information. +/// are used. +/// +/// See [the formatting syntax documentation in `std::fmt`](../std/fmt/index.html) +/// for details. /// /// A common use for `format!` is concatenation and interpolation of strings. /// The same convention is used with [`print!`] and [`write!`] macros, @@ -91,7 +93,6 @@ macro_rules! vec { /// To convert a single value to a string, use the [`to_string`] method. This /// will use the [`Display`] formatting trait. /// -/// [`std::fmt`]: ../std/fmt/index.html /// [`print!`]: ../std/macro.print.html /// [`write!`]: core::write /// [`to_string`]: crate::string::ToString diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 14cc523b0c1..46628bcea00 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -849,7 +849,8 @@ pub(crate) mod builtin { /// assert_eq!(display, debug); /// ``` /// - /// For more information, see the documentation in [`std::fmt`]. + /// See [the formatting documentation in `std::fmt`](../std/fmt/index.html) + /// for details of the macro argument syntax, and further information. /// /// [`Display`]: crate::fmt::Display /// [`Debug`]: crate::fmt::Debug |
