File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
13
13
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
14
14
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
15
15
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16
- refs/heads/auto: 333592edde810324c9730a89372fa5164d10871d
16
+ refs/heads/auto: 45044124e46bbfd1ab9869ffce71259ae93866ff
17
17
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
18
18
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
19
19
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Original file line number Diff line number Diff line change @@ -871,13 +871,17 @@ impl NonSnakeCase {
871
871
fn to_snake_case ( str : & str ) -> String {
872
872
let mut words = vec ! [ ] ;
873
873
for s in str. split ( '_' ) {
874
+ let mut last_upper = false ;
874
875
let mut buf = String :: new ( ) ;
875
876
if s. is_empty ( ) { continue ; }
876
877
for ch in s. chars ( ) {
877
- if !buf. is_empty ( ) && buf. as_slice ( ) != "'" && ch. is_uppercase ( ) {
878
+ if !buf. is_empty ( ) && buf. as_slice ( ) != "'"
879
+ && ch. is_uppercase ( )
880
+ && !last_upper {
878
881
words. push ( buf) ;
879
882
buf = String :: new ( ) ;
880
883
}
884
+ last_upper = ch. is_uppercase ( ) ;
881
885
buf. push_char ( ch. to_lowercase ( ) ) ;
882
886
}
883
887
words. push ( buf) ;
Original file line number Diff line number Diff line change @@ -23,11 +23,14 @@ impl Foo {
23
23
24
24
pub fn xyZ ( & mut self ) { }
25
25
//~^ ERROR method `xyZ` should have a snake case name such as `xy_z`
26
+
27
+ fn render_HTML ( ) { }
28
+ //~^ ERROR method `render_HTML` should have a snake case name such as `render_html`
26
29
}
27
30
28
31
trait X {
29
32
fn ABC ( ) ;
30
- //~^ ERROR trait method `ABC` should have a snake case name such as `a_b_c `
33
+ //~^ ERROR trait method `ABC` should have a snake case name such as `abc `
31
34
32
35
fn a_b_C ( & self ) { }
33
36
//~^ ERROR trait method `a_b_C` should have a snake case name such as `a_b_c`
You can’t perform that action at this time.
0 commit comments