From 6418cb47d4ea58ad3bba87939efb64af1cc1e194 Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Sat, 25 Jun 2016 01:59:14 +0200 Subject: [PATCH] Add example with leading zeros --- src/libcollections/fmt.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index 6f77d79ab0bfe..15de0dd802d99 100644 --- a/src/libcollections/fmt.rs +++ b/src/libcollections/fmt.rs @@ -28,6 +28,7 @@ //! format!("{:?}", (3, 4)); // => "(3, 4)" //! format!("{value}", value=4); // => "4" //! format!("{} {}", 1, 2); // => "1 2" +//! format!("{:04}", 42); // => "0042" with leading zeros //! ``` //! //! From these, you can see that the first argument is a format string. It is