diff options
author | Igor Aleksanov <[email protected]> | 2020-10-05 17:34:23 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-10-12 09:05:00 +0100 |
commit | f2c91fc5a8c22b8ac80f100b2b666f2dc9baa67c (patch) | |
tree | d9380ebf0b5b1226e72f6431ea11468e74640a56 /crates/stdx | |
parent | 9ea57cac0e9779ac0749ef568eeb3977fe3adacd (diff) |
Apply suggestions from code review
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/stdx')
-rw-r--r-- | crates/stdx/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs index 522a9c1ab..b55de813e 100644 --- a/crates/stdx/src/lib.rs +++ b/crates/stdx/src/lib.rs | |||
@@ -35,7 +35,7 @@ pub fn to_lower_snake_case(s: &str) -> String { | |||
35 | // `&& prev` is required to not insert `_` before the first symbol. | 35 | // `&& prev` is required to not insert `_` before the first symbol. |
36 | if c.is_ascii_uppercase() && prev { | 36 | if c.is_ascii_uppercase() && prev { |
37 | // This check is required to not translate `Weird_Case` into `weird__case`. | 37 | // This check is required to not translate `Weird_Case` into `weird__case`. |
38 | if buf.chars().last() != Some('_') { | 38 | if !buf.ends_with('_') { |
39 | buf.push('_') | 39 | buf.push('_') |
40 | } | 40 | } |
41 | } | 41 | } |