diff options
author | Aleksey Kladov <[email protected]> | 2020-11-02 12:13:32 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-11-02 13:07:08 +0000 |
commit | b6101184537b1165cfdd5fc473e04ad4c5b7bffa (patch) | |
tree | bcc2efd8a2696840a4724ad88758e973ecb77157 /crates/hir_ty/src/diagnostics/decl_check | |
parent | e7f90866bcf4b04a11e958eda0ac53f7ff0a607b (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.rs | 6 |
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. |
9 | pub fn to_camel_case(ident: &str) -> Option<String> { | 9 | pub(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. |
62 | pub fn to_lower_snake_case(ident: &str) -> Option<String> { | 62 | pub(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. |
74 | pub fn to_upper_snake_case(ident: &str) -> Option<String> { | 74 | pub(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) { |