149
149
//!
150
150
//! Additionally, the return value of this function is [`fmt::Result`] which is a
151
151
//! type alias of [`Result`]`<(), `[`std::fmt::Error`]`>`. Formatting implementations
152
- //! should ensure that they propagate errors from the [`Formatter`] (e.g., when
152
+ //! should ensure that they propagate errors from the [`Formatter`][`Formatter`] (e.g., when
153
153
//! calling [`write!`]) however, they should never return errors spuriously. That
154
154
//! is, a formatting implementation must and may only return an error if the
155
155
//! passed-in [`Formatter`] returns an error. This is because, contrary to what
209
209
//!
210
210
//! These two formatting traits have distinct purposes:
211
211
//!
212
- //! - [`fmt::Display`][`Display] implementations assert that the type can be faithfully
212
+ //! - [`fmt::Display`][`Display` ] implementations assert that the type can be faithfully
213
213
//! represented as a UTF-8 string at all times. It is **not** expected that
214
214
//! all types implement the `Display` trait.
215
215
//! - [`fmt::Debug`][`Debug`] implementations should be implemented for **all** public types.
357
357
//! * `-` - Currently not used
358
358
//! * `#` - This flag is indicates that the "alternate" form of printing should
359
359
//! be used. The alternate forms are:
360
- //! * `#?` - pretty-print the `Debug` formatting
360
+ //! * `#?` - pretty-print the [ `Debug`] formatting
361
361
//! * `#x` - precedes the argument with a `0x`
362
362
//! * `#X` - precedes the argument with a `0x`
363
363
//! * `#b` - precedes the argument with a `0b`
475
475
//! them with the same character. For example, the `{` character is escaped with
476
476
//! `{{` and the `}` character is escaped with `}}`.
477
477
//!
478
- //! [`format!`]: ../macro.format.html
479
- //! [`usize`]: ../primitive.usize.html
480
- //! [`isize`]: ../primitive.isize.html
481
- //! [`i8`]: ../primitive.i8.html
478
+ //! [`format!`]: ../../ macro.format.html
479
+ //! [`usize`]: ../../std/ primitive.usize.html
480
+ //! [`isize`]: ../../std/ primitive.isize.html
481
+ //! [`i8`]: ../../std/ primitive.i8.html
482
482
//! [`Display`]: trait.Display.html
483
483
//! [`Binary`]: trait.Binary.html
484
484
//! [`fmt::Result`]: type.Result.html
485
- //! [`Result`]: ../result/enum.Result.html
485
+ //! [`Result`]: ../../std/ result/enum.Result.html
486
486
//! [`std::fmt::Error`]: struct.Error.html
487
487
//! [`Formatter`]: struct.Formatter.html
488
- //! [`write!`]: ../macro.write.html
488
+ //! [`write!`]: ../../std/ macro.write.html
489
489
//! [`Debug`]: trait.Debug.html
490
- //! [`format!`]: ../macro.format.html
491
- //! [`writeln!`]: ../macro.writeln.html
492
- //! [`write_fmt`]: ../io/trait.Write.html#method.write_fmt
493
- //! [`std::io::Write`]: ../io/trait.Write.html
494
- //! [`println!`]: ../macro.println.html
495
- //! [`write!`]: ../macro.write.html
496
- //! [`format_args!`]: ../macro.format_args.html
490
+ //! [`format!`]: ../../std/ macro.format.html
491
+ //! [`writeln!`]: ../../std/ macro.writeln.html
492
+ //! [`write_fmt`]: ../../std/ io/trait.Write.html#method.write_fmt
493
+ //! [`std::io::Write`]: ../../std/ io/trait.Write.html
494
+ //! [`println!`]: ../../std/ macro.println.html
495
+ //! [`write!`]: ../../std/ macro.write.html
496
+ //! [`format_args!`]: ../../std/ macro.format_args.html
497
497
//! [`fmt::Arguments`]: struct.Arguments.html
498
498
//! [`write`]: fn.write.html
499
499
//! [`format`]: fn.format.html
@@ -521,10 +521,10 @@ pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
521
521
522
522
use string;
523
523
524
- /// The `format` function takes an `Arguments` struct and returns the resulting
524
+ /// The `format` function takes an [ `Arguments`] struct and returns the resulting
525
525
/// formatted string.
526
526
///
527
- /// The `Arguments` instance can be created with the `format_args!` macro.
527
+ /// The [ `Arguments`] instance can be created with the [ `format_args!`] macro.
528
528
///
529
529
/// # Examples
530
530
///
@@ -537,15 +537,17 @@ use string;
537
537
/// assert_eq!(s, "Hello, world!");
538
538
/// ```
539
539
///
540
- /// Please note that using [`format!`][format!] might be preferrable.
540
+ /// Please note that using [`format!`] might be preferrable.
541
541
/// Example:
542
542
///
543
543
/// ```
544
544
/// let s = format!("Hello, {}!", "world");
545
545
/// assert_eq!(s, "Hello, world!");
546
546
/// ```
547
547
///
548
- /// [format!]: ../macro.format.html
548
+ /// [`Arguments`]: struct.Arguments.html
549
+ /// [`format_args!`]: ../../std/macro.format_args.html
550
+ /// [`format!`]: ../../std/macro.format.html
549
551
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
550
552
pub fn format ( args : Arguments ) -> string:: String {
551
553
let capacity = args. estimated_capacity ( ) ;
0 commit comments