mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 19:49:36 +00:00
Have inline_local_variable use precedence calculation for parentheses
This commit is contained in:
parent
2c4ef382d6
commit
e92dc3fd80
5 changed files with 44 additions and 67 deletions
|
|
@ -269,7 +269,7 @@ impl ast::ByteString {
|
|||
}
|
||||
(Ok(c), true) => {
|
||||
buf.reserve_exact(text.len());
|
||||
buf.extend_from_slice(text[..prev_end].as_bytes());
|
||||
buf.extend_from_slice(&text.as_bytes()[..prev_end]);
|
||||
buf.push(c as u8);
|
||||
}
|
||||
(Err(e), _) => has_error = Some(e),
|
||||
|
|
@ -333,7 +333,7 @@ impl ast::CString {
|
|||
}
|
||||
(Ok(u), true) => {
|
||||
buf.reserve_exact(text.len());
|
||||
buf.extend(text[..prev_end].as_bytes());
|
||||
buf.extend(&text.as_bytes()[..prev_end]);
|
||||
extend_unit(&mut buf, u);
|
||||
}
|
||||
(Err(e), _) => has_error = Some(e),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue