Override fmt_dangling_comments for frequent nodes (#6551)

This commit is contained in:
Micha Reiser 2023-08-14 15:29:05 +02:00 committed by GitHub
parent 680d171ae5
commit fc0c9507d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -780,7 +780,8 @@ where
Context: FormatContext,
{
let mut state = FormatState::new(context);
let mut buffer = VecBuffer::with_capacity(arguments.items().len(), &mut state);
let mut buffer =
VecBuffer::with_capacity(state.context().source_code().as_str().len(), &mut state);
buffer.write_fmt(arguments)?;