Skip to content

Commit a4d1806

Browse files
author
chansuke
committed
Add a condition of camel case detection
1 parent 42f32a0 commit a4d1806

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

clippy_lints/src/utils/camel_case.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn from(s: &str) -> usize {
4747
let mut last_i = s.len();
4848
for (i, c) in iter {
4949
if down {
50-
if c.is_uppercase() {
50+
if c.is_uppercase() && !s.chars().nth(i - 1).unwrap().is_uppercase() {
5151
down = false;
5252
last_i = i;
5353
} else if !c.is_lowercase() {

tests/ui/escape_analysis.stderr

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +0,0 @@
1-
error: local variable doesn't need to be boxed here
2-
--> $DIR/escape_analysis.rs:39:13
3-
|
4-
LL | fn warn_arg(x: Box<A>) {
5-
| ^
6-
|
7-
= note: `-D clippy::boxed-local` implied by `-D warnings`
8-
9-
error: local variable doesn't need to be boxed here
10-
--> $DIR/escape_analysis.rs:130:12
11-
|
12-
LL | pub fn new(_needs_name: Box<PeekableSeekable<&()>>) -> () {}
13-
| ^^^^^^^^^^^
14-
15-
error: aborting due to 2 previous errors
16-

0 commit comments

Comments
 (0)