Skip to content

Commit 1b91d98

Browse files
committed
Rename clippy_utils::camal_case to clippy_utils::str_utils
1 parent ba0cfc7 commit 1b91d98

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clippy_lints/src/enum_variants.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! lint on enum variants that are prefixed or suffixed by the same characters
22
3-
use clippy_utils::camel_case;
3+
use clippy_utils::str_utils;
44
use clippy_utils::diagnostics::{span_lint, span_lint_and_help};
55
use clippy_utils::source::is_present_in_source;
66
use rustc_hir::{EnumDef, Item, ItemKind};
@@ -171,22 +171,22 @@ fn check_variant(
171171
}
172172
}
173173
let first = &def.variants[0].ident.name.as_str();
174-
let mut pre = &first[..camel_case::until(&*first)];
175-
let mut post = &first[camel_case::from(&*first)..];
174+
let mut pre = &first[..str_utils::until(&*first)];
175+
let mut post = &first[str_utils::from(&*first)..];
176176
for var in def.variants {
177177
let name = var.ident.name.as_str();
178178

179179
let pre_match = partial_match(pre, &name);
180180
pre = &pre[..pre_match];
181-
let pre_camel = camel_case::until(pre);
181+
let pre_camel = str_utils::until(pre);
182182
pre = &pre[..pre_camel];
183183
while let Some((next, last)) = name[pre.len()..].chars().zip(pre.chars().rev()).next() {
184184
if next.is_numeric() {
185185
return;
186186
}
187187
if next.is_lowercase() {
188188
let last = pre.len() - last.len_utf8();
189-
let last_camel = camel_case::until(&pre[..last]);
189+
let last_camel = str_utils::until(&pre[..last]);
190190
pre = &pre[..last_camel];
191191
} else {
192192
break;
@@ -196,7 +196,7 @@ fn check_variant(
196196
let post_match = partial_rmatch(post, &name);
197197
let post_end = post.len() - post_match;
198198
post = &post[post_end..];
199-
let post_camel = camel_case::from(post);
199+
let post_camel = str_utils::from(post);
200200
post = &post[post_camel..];
201201
}
202202
let (what, value) = match (pre.is_empty(), post.is_empty()) {

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub mod sym_helper;
3737
#[allow(clippy::module_name_repetitions)]
3838
pub mod ast_utils;
3939
pub mod attrs;
40-
pub mod camel_case;
40+
pub mod str_utils;
4141
pub mod comparisons;
4242
pub mod consts;
4343
pub mod diagnostics;
File renamed without changes.

0 commit comments

Comments
 (0)