|
1 | 1 | use std::path::{Path, PathBuf}; |
2 | 2 |
|
3 | 3 | use clap::{Args, Parser, Subcommand, ValueHint::DirPath}; |
4 | | -use convert_case::{Boundary, Case, Casing, pattern}; |
| 4 | +use convert_case::{Case, Casing, Pattern, delim_boundary}; |
5 | 5 | use derive_builder::Builder; |
6 | 6 |
|
7 | 7 | #[derive(Parser)] |
@@ -58,7 +58,7 @@ pub struct Generate { |
58 | 58 | long, |
59 | 59 | short, |
60 | 60 | value_name = "dotted.case", |
61 | | - value_parser = dotted_case |
| 61 | + value_parser = dot_case |
62 | 62 | )] |
63 | 63 | pub java: Option<String>, |
64 | 64 |
|
@@ -130,10 +130,10 @@ impl BindgenArgsBuilder { |
130 | 130 | } |
131 | 131 | } |
132 | 132 |
|
133 | | -fn dotted_case(s: &str) -> Result<String, String> { |
| 133 | +fn dot_case(s: &str) -> Result<String, String> { |
134 | 134 | const DOT_CASE: Case = Case::Custom { |
135 | | - boundaries: &[Boundary::from_delim(".")], |
136 | | - pattern: pattern::lowercase, |
| 135 | + boundaries: &[delim_boundary!(".")], |
| 136 | + pattern: Pattern::Lowercase, |
137 | 137 | delim: ".", |
138 | 138 | }; |
139 | 139 | if s.is_case(DOT_CASE) { |
@@ -172,11 +172,11 @@ mod cli_tests { |
172 | 172 | #[test] |
173 | 173 | fn dotted() { |
174 | 174 | assert_eq!( |
175 | | - dotted_case("com.example.crux.shared.types").unwrap(), |
| 175 | + dot_case("com.example.crux.shared.types").unwrap(), |
176 | 176 | "com.example.crux.shared.types" |
177 | 177 | ); |
178 | 178 | assert_eq!( |
179 | | - dotted_case("comExampleCruxSharedTypes").unwrap_err(), |
| 179 | + dot_case("comExampleCruxSharedTypes").unwrap_err(), |
180 | 180 | "Invalid dotted case: comExampleCruxSharedTypes" |
181 | 181 | ); |
182 | 182 | } |
|
0 commit comments