// String that is placed within the assignment pattern and expression.
let infix = {
- let mut infix = String::new();
+ let mut infix = String::with_capacity(32);
if let Some(ref ty) = self.ty {
let separator = type_annotation_separator(context.config);
_,
) = item.node
{
- let mut result = String::new();
+ let mut result = String::with_capacity(128);
result.push_str(&format_visibility(&item.vis));
result.push_str(&format_defaultness(defaultness));
vis: &ast::Visibility,
span: Span,
) -> Option<String> {
- let mut result = String::new();
+ let mut result = String::with_capacity(128);
result.push_str(&format_visibility(vis));
result.push_str("type ");
impl<'a> Rewrite for [ast::Attribute] {
fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
- let mut result = String::new();
if self.is_empty() {
- return Some(result);
+ return Some(String::new());
}
+ let mut result = String::with_capacity(128);
let indent = shape.indent.to_string(context.config);
let mut derive_args = Vec::new();