Reduce amount of allocations in RustLsp label handling (#35786)
There can be a lot of completions after all Release Notes: - N/A
This commit is contained in:
parent
c397027ec2
commit
4dbd24d75f
9 changed files with 40 additions and 65 deletions
|
@ -471,11 +471,19 @@ impl<'a> FromIterator<&'a str> for Rope {
|
|||
}
|
||||
|
||||
impl From<String> for Rope {
|
||||
#[inline(always)]
|
||||
fn from(text: String) -> Self {
|
||||
Rope::from(text.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&String> for Rope {
|
||||
#[inline(always)]
|
||||
fn from(text: &String) -> Self {
|
||||
Rope::from(text.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Rope {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
for chunk in self.chunks() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue