mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-19 08:40:24 +00:00
Apply suggestions from code review
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
9ea57cac0e
commit
f2c91fc5a8
2 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ pub fn to_lower_snake_case(s: &str) -> String {
|
|||
// `&& prev` is required to not insert `_` before the first symbol.
|
||||
if c.is_ascii_uppercase() && prev {
|
||||
// This check is required to not translate `Weird_Case` into `weird__case`.
|
||||
if buf.chars().last() != Some('_') {
|
||||
if !buf.ends_with('_') {
|
||||
buf.push('_')
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue