diff --git a/.gitignore b/.gitignore index 972f527046b..acd47803969 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ /*-*-*/ /Makefile /build +/config.toml /dist/ /dl/ /doc diff --git a/src/doc/footer.inc b/src/doc/footer.inc index b5eb589eb53..952846dd5e2 100644 --- a/src/doc/footer.inc +++ b/src/doc/footer.inc @@ -1,7 +1,7 @@ diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index ce1d6ec5a64..0ebb89b8a22 100644 --- a/src/libcollections/fmt.rs +++ b/src/libcollections/fmt.rs @@ -81,7 +81,7 @@ //! //! ``` //! format!("{argument}", argument = "test"); // => "test" -//! format!("{name} {}", 1, name = 2); // => "2 1" +//! format!("{name} {}", 1, name = 2); // => "2 1" //! format!("{a} {c} {b}", a="a", b='b', c=3); // => "a 3 b" //! ``` //! @@ -104,8 +104,8 @@ //! octal. //! //! There are various parameters which do require a particular type, however. -//! Namely, the `{:.*}` syntax, which sets the number of numbers after the -//! decimal in floating-point types: +//! An example is the `{:.*}` syntax, which sets the number of decimal places +//! in floating-point types: //! //! ``` //! let formatted_number = format!("{:.*}", 2, 1.234567); @@ -292,15 +292,13 @@ //! use std::fmt; //! use std::io::{self, Write}; //! -//! fmt::format(format_args!("this returns {}", "String")); -//! //! let mut some_writer = io::stdout(); //! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro")); //! //! fn my_fmt_fn(args: fmt::Arguments) { //! write!(&mut io::stdout(), "{}", args); //! } -//! my_fmt_fn(format_args!("or a {} too", "function")); +//! my_fmt_fn(format_args!(", or a {} too", "function")); //! ``` //! //! The result of the `format_args!` macro is a value of type `fmt::Arguments`. @@ -316,7 +314,7 @@ //! # Syntax //! //! The syntax for the formatting language used is drawn from other languages, -//! so it should not be too alien. Arguments are formatted with python-like +//! so it should not be too alien. Arguments are formatted with Python-like //! syntax, meaning that arguments are surrounded by `{}` instead of the C-like //! `%`. The actual grammar for the formatting syntax is: //! @@ -527,7 +525,7 @@ use string; /// use std::fmt; /// /// let s = fmt::format(format_args!("Hello, {}!", "world")); -/// assert_eq!(s, "Hello, world!".to_string()); +/// assert_eq!(s, "Hello, world!"); /// ``` /// /// Please note that using [`format!`][format!] might be preferrable. @@ -535,7 +533,7 @@ use string; /// /// ``` /// let s = format!("Hello, {}!", "world"); -/// assert_eq!(s, "Hello, world!".to_string()); +/// assert_eq!(s, "Hello, world!"); /// ``` /// /// [format!]: ../macro.format!.html