Pre-allocate output contents during autofix application (#2340)

This commit is contained in:
Charlie Marsh
2023-01-29 22:40:27 -05:00
committed by GitHub
parent 74e3cdfd7c
commit 7a83b65fbe
2 changed files with 10 additions and 2 deletions

View File

@@ -139,6 +139,14 @@ impl<'a> Locator<'a> {
&self.contents[inner_end..outer_end],
)
}
pub fn len(&self) -> usize {
self.contents.len()
}
pub fn is_empty(&self) -> bool {
self.contents.is_empty()
}
}
#[cfg(test)]