Skip to content

Commit

Permalink
naming cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Jan 16, 2025
1 parent 7380342 commit 139aa0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use strum_macros::EnumIter;
)]
pub struct ComponentName(String);

static COMPONENT_NAME_SPLIT_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new("(?=[A-Z\\-_])").unwrap());
static COMPONENT_NAME_SPLIT_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new("(?=[A-Z\\-_:])").unwrap());

impl ComponentName {
pub fn new(name: impl AsRef<str>) -> ComponentName {
Expand Down Expand Up @@ -45,6 +45,7 @@ impl ComponentName {
let s = part.to_lowercase();
let s = s.strip_prefix('-').unwrap_or(&s);
let s = s.strip_prefix('_').unwrap_or(s);
let s = s.strip_prefix(':').unwrap_or(s);
result.push(s.to_string());
}
result
Expand Down

0 comments on commit 139aa0f

Please sign in to comment.