diff options
| author | Ryan Prichard <ryan.prichard@gmail.com> | 2015-04-16 21:49:53 -0700 |
|---|---|---|
| committer | Ryan Prichard <ryan.prichard@gmail.com> | 2015-04-16 21:49:53 -0700 |
| commit | 317eac3277ccfa9b3cd159760041964253d17ef5 (patch) | |
| tree | a40f67b8f7fd288b3be6cd0c7e12d26d42c31b79 /src/libcollections | |
| parent | 8f209d5a3e07b01de3a670689c4929870b40db7d (diff) | |
| download | rust-317eac3277ccfa9b3cd159760041964253d17ef5.tar.gz rust-317eac3277ccfa9b3cd159760041964253d17ef5.zip | |
Call write_fmt directly to format an Arguments value.
It's just as convenient, but it's much faster. Using write! requires an extra call to fmt::write and a extra dynamically dispatched call to Arguments' Display format function.
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/fmt.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index 46b1ad2138b..5f0d9012d1a 100644 --- a/src/libcollections/fmt.rs +++ b/src/libcollections/fmt.rs @@ -443,6 +443,6 @@ use string; #[stable(feature = "rust1", since = "1.0.0")] pub fn format(args: Arguments) -> string::String { let mut output = string::String::new(); - let _ = write!(&mut output, "{}", args); + let _ = output.write_fmt(args); output } |
