]> git.lizzy.rs Git - rust.git/commitdiff
Mention ToString in std::fmt docs
authorCzipperz <czipperz@gmail.com>
Sat, 29 Dec 2018 07:54:05 +0000 (02:54 -0500)
committerCzipperz <czipperz@gmail.com>
Sun, 30 Dec 2018 00:17:03 +0000 (19:17 -0500)
src/liballoc/fmt.rs
src/liballoc/macros.rs

index 73e2c4494feef28664bef36139bf2e3395a24c96..a1e7533449c699fb7faecb1b481d18ce64e44fb7 100644 (file)
@@ -27,6 +27,9 @@
 //! will then parse the format string and determine if the list of arguments
 //! provided is suitable to pass to this format string.
 //!
+//! To convert a single value to a string, use the [`to_string`] method.  This
+//! will use the [`Display`] formatting trait.
+//!
 //! ## Positional parameters
 //!
 //! Each formatting argument is allowed to specify which value argument it's
 //! [`write!`]: ../../std/macro.write.html
 //! [`Debug`]: trait.Debug.html
 //! [`format!`]: ../../std/macro.format.html
+//! [`to_string`]: ../../std/string/trait.ToString.html
 //! [`writeln!`]: ../../std/macro.writeln.html
 //! [`write_fmt`]: ../../std/io/trait.Write.html#method.write_fmt
 //! [`std::io::Write`]: ../../std/io/trait.Write.html
index 1978efda097f21cd006ec20888fe7f90c4a7c99a..db91b07fa71b46b9e919d89db5bda4aed7ef2f8e 100644 (file)
@@ -73,9 +73,14 @@ macro_rules! vec {
 /// The same convention is used with [`print!`] and [`write!`] macros,
 /// depending on the intended destination of the string.
 ///
+/// To convert a single value to a string, use the [`to_string`] method.  This
+/// will use the [`Display`] formatting trait.
+///
 /// [fmt]: ../std/fmt/index.html
 /// [`print!`]: ../std/macro.print.html
 /// [`write!`]: ../std/macro.write.html
+/// [`to_string`]: ../std/string/trait.ToString.html
+/// [`Display`]: ../std/fmt/trait.Display.html
 ///
 /// # Panics
 ///