mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Use snippets in add function
This commit is contained in:
parent
9c3acd3028
commit
8eb3272ad6
5 changed files with 75 additions and 40 deletions
|
@ -116,3 +116,11 @@ pub fn to_lower_snake_case(s: &str) -> String {
|
|||
}
|
||||
buf
|
||||
}
|
||||
|
||||
pub fn replace(buf: &mut String, from: char, to: &str) {
|
||||
if !buf.contains(from) {
|
||||
return;
|
||||
}
|
||||
// FIXME: do this in place.
|
||||
*buf = buf.replace(from, to)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue