mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-04 18:58:41 +00:00
move is_upper_snake_case to stdx
This commit is contained in:
parent
5b2a2bc3fb
commit
1f91c487a2
2 changed files with 5 additions and 3 deletions
|
@ -171,6 +171,10 @@ pub fn char_has_case(c: char) -> bool {
|
|||
c.is_lowercase() || c.is_uppercase()
|
||||
}
|
||||
|
||||
pub fn is_upper_snake_case(s: &str) -> bool {
|
||||
s.chars().all(|c| c.is_uppercase() || c == '_' || c.is_numeric())
|
||||
}
|
||||
|
||||
pub fn replace(buf: &mut String, from: char, to: &str) {
|
||||
if !buf.contains(from) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue