about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorCzipperz <czipperz@gmail.com>2018-12-29 02:54:05 -0500
committerCzipperz <czipperz@gmail.com>2018-12-29 19:17:03 -0500
commit56d6ff0634e61bcf0a1e26c27cf346f5d170eb59 (patch)
treec407881201d1e6fb633d02a855141beb1e9e4dcb /src/liballoc
parent43d26b1f35401c9341154192db000db456ee5ca2 (diff)
downloadrust-56d6ff0634e61bcf0a1e26c27cf346f5d170eb59.tar.gz
rust-56d6ff0634e61bcf0a1e26c27cf346f5d170eb59.zip
Mention ToString in std::fmt docs
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/fmt.rs4
-rw-r--r--src/liballoc/macros.rs5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/liballoc/fmt.rs b/src/liballoc/fmt.rs
index 73e2c4494fe..a1e7533449c 100644
--- a/src/liballoc/fmt.rs
+++ b/src/liballoc/fmt.rs
@@ -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
@@ -487,6 +490,7 @@
 //! [`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
diff --git a/src/liballoc/macros.rs b/src/liballoc/macros.rs
index 1978efda097..db91b07fa71 100644
--- a/src/liballoc/macros.rs
+++ b/src/liballoc/macros.rs
@@ -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
 ///