|
460 | 460 | //! |
461 | 461 | //! ```ignore (only-for-syntax-highlight) |
462 | 462 | //! format! // described above |
463 | | -//! write! // first argument is a &mut io::Write, the destination |
| 463 | +//! write! // first argument is either a &mut io::Write or a &mut fmt::Write, the destination |
464 | 464 | //! writeln! // same as write but appends a newline |
465 | 465 | //! print! // the format string is printed to the standard output |
466 | 466 | //! println! // same as print but appends a newline |
|
471 | 471 | //! |
472 | 472 | //! ### `write!` |
473 | 473 | //! |
474 | | -//! This and [`writeln!`] are two macros which are used to emit the format string |
| 474 | +//! [`write!`] and [`writeln!`] are two macros which are used to emit the format string |
475 | 475 | //! to a specified stream. This is used to prevent intermediate allocations of |
476 | 476 | //! format strings and instead directly write the output. Under the hood, this |
477 | 477 | //! function is actually invoking the [`write_fmt`] function defined on the |
478 | | -//! [`std::io::Write`] trait. Example usage is: |
| 478 | +//! [`std::io::Write`] and the [`std::fmt::Write`] trait. Example usage is: |
479 | 479 | //! |
480 | 480 | //! ``` |
481 | 481 | //! # #![allow(unused_must_use)] |
|
502 | 502 | //! |
503 | 503 | //! ### `format_args!` |
504 | 504 | //! |
505 | | -//! This is a curious macro used to safely pass around |
| 505 | +//! [`format_args!`] is a curious macro used to safely pass around |
506 | 506 | //! an opaque object describing the format string. This object |
507 | 507 | //! does not require any heap allocations to create, and it only |
508 | 508 | //! references information on the stack. Under the hood, all of |
|
540 | 540 | //! [`to_string`]: crate::string::ToString::to_string "ToString::to_string" |
541 | 541 | //! [`write_fmt`]: ../../std/io/trait.Write.html#method.write_fmt |
542 | 542 | //! [`std::io::Write`]: ../../std/io/trait.Write.html |
| 543 | +//! [`std::fmt::Write`]: ../../std/fmt/trait.Write.html |
543 | 544 | //! [`print!`]: ../../std/macro.print.html "print!" |
544 | 545 | //! [`println!`]: ../../std/macro.println.html "println!" |
545 | 546 | //! [`eprint!`]: ../../std/macro.eprint.html "eprint!" |
546 | 547 | //! [`eprintln!`]: ../../std/macro.eprintln.html "eprintln!" |
| 548 | +//! [`format_args!`]: ../../std/macro.format_args.html "format_args!" |
547 | 549 | //! [`fmt::Arguments`]: Arguments "fmt::Arguments" |
548 | 550 | //! [`format`]: format() "fmt::format" |
549 | 551 |
|
|
0 commit comments