aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics/decl_check
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-11-02 12:13:32 +0000
committerAleksey Kladov <[email protected]>2020-11-02 13:07:08 +0000
commitb6101184537b1165cfdd5fc473e04ad4c5b7bffa (patch)
treebcc2efd8a2696840a4724ad88758e973ecb77157 /crates/hir_ty/src/diagnostics/decl_check
parente7f90866bcf4b04a11e958eda0ac53f7ff0a607b (diff)
Deny unreachable-pub
It's very useful when `pub` is equivalent to "this is crate's public API", let's enforce this! Ideally, we should enforce it for local `cargo test`, and only during CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
Diffstat (limited to 'crates/hir_ty/src/diagnostics/decl_check')
-rw-r--r--crates/hir_ty/src/diagnostics/decl_check/case_conv.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs b/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs
index b0144a289..14e4d92f0 100644
--- a/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs
+++ b/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs
@@ -6,7 +6,7 @@
6 6
7/// Converts an identifier to an UpperCamelCase form. 7/// Converts an identifier to an UpperCamelCase form.
8/// Returns `None` if the string is already is UpperCamelCase. 8/// Returns `None` if the string is already is UpperCamelCase.
9pub fn to_camel_case(ident: &str) -> Option<String> { 9pub(crate) fn to_camel_case(ident: &str) -> Option<String> {
10 if is_camel_case(ident) { 10 if is_camel_case(ident) {
11 return None; 11 return None;
12 } 12 }
@@ -59,7 +59,7 @@ pub fn to_camel_case(ident: &str) -> Option<String> {
59 59
60/// Converts an identifier to a lower_snake_case form. 60/// Converts an identifier to a lower_snake_case form.
61/// Returns `None` if the string is already in lower_snake_case. 61/// Returns `None` if the string is already in lower_snake_case.
62pub fn to_lower_snake_case(ident: &str) -> Option<String> { 62pub(crate) fn to_lower_snake_case(ident: &str) -> Option<String> {
63 if is_lower_snake_case(ident) { 63 if is_lower_snake_case(ident) {
64 return None; 64 return None;
65 } else if is_upper_snake_case(ident) { 65 } else if is_upper_snake_case(ident) {
@@ -71,7 +71,7 @@ pub fn to_lower_snake_case(ident: &str) -> Option<String> {
71 71
72/// Converts an identifier to an UPPER_SNAKE_CASE form. 72/// Converts an identifier to an UPPER_SNAKE_CASE form.
73/// Returns `None` if the string is already is UPPER_SNAKE_CASE. 73/// Returns `None` if the string is already is UPPER_SNAKE_CASE.
74pub fn to_upper_snake_case(ident: &str) -> Option<String> { 74pub(crate) fn to_upper_snake_case(ident: &str) -> Option<String> {
75 if is_upper_snake_case(ident) { 75 if is_upper_snake_case(ident) {
76 return None; 76 return None;
77 } else if is_lower_snake_case(ident) { 77 } else if is_lower_snake_case(ident) {