remove useless cold
This commit is contained in:
parent
3f404bfa86
commit
5dd0fe301a
1 changed files with 2 additions and 3 deletions
|
@ -606,13 +606,12 @@ use crate::string;
|
|||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn format(args: Arguments<'_>) -> string::String {
|
||||
#[cold]
|
||||
fn format_cold(args: Arguments<'_>) -> string::String {
|
||||
fn format_inner(args: Arguments<'_>) -> string::String {
|
||||
let capacity = args.estimated_capacity();
|
||||
let mut output = string::String::with_capacity(capacity);
|
||||
output.write_fmt(args).expect("a formatting trait implementation returned an error");
|
||||
output
|
||||
}
|
||||
|
||||
args.as_str().map_or_else(|| format_cold(args), crate::borrow::ToOwned::to_owned)
|
||||
args.as_str().map_or_else(|| format_inner(args), crate::borrow::ToOwned::to_owned)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue