diff options
| author | bors <bors@rust-lang.org> | 2016-05-15 18:22:51 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-05-15 18:22:51 -0700 |
| commit | bb39c4925a792b1dbb2bfa0323339fdf4297c4ac (patch) | |
| tree | 5e6fe8318fc1c313fb09be3f7989f0222ab302c3 /src | |
| parent | 5ebe41835fcc3dbfdbe282a9b4c3780968c0a97a (diff) | |
| parent | ffbfbe452c29b6fb92836862f4b5b31383b4ef0c (diff) | |
| download | rust-bb39c4925a792b1dbb2bfa0323339fdf4297c4ac.tar.gz rust-bb39c4925a792b1dbb2bfa0323339fdf4297c4ac.zip | |
Auto merge of #33643 - eddyb:rollup, r=eddyb
Rollup of 27 pull requests - Successful merges: #33342, #33393, #33415, #33475, #33517, #33533, #33534, #33565, #33580, #33584, #33585, #33588, #33590, #33591, #33593, #33598, #33600, #33602, #33603, #33604, #33605, #33607, #33612, #33620, #33633, #33634, #33635 - Failed merges: #33578
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/footer.inc | 2 | ||||
| -rw-r--r-- | src/libcollections/fmt.rs | 16 |
2 files changed, 8 insertions, 10 deletions
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 @@ <footer><p> Copyright © 2011-2015 The Rust Project Developers. Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> -or the <a href="http://opensource.org/licenses/MIT">MIT license</a>, at your option. +or the <a href="https://opensource.org/licenses/MIT">MIT license</a>, at your option. </p><p> This file may not be copied, modified, or distributed except according to those terms. </p></footer> 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 |
