domain: Slug::from_title is dead code duplicating Title::to_slug #69
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
rosa/vernier#69
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during a code review of the
domaincrate.Location:
crates/domain/src/models/post.rs:141(Slug::from_title) vspost.rs:58(Title::to_slug)Type: Cleanup — dead code / duplication
Problem
Slug::from_titleandTitle::to_slugare both one-line wrappers aroundSlug::parse(title.as_str()), and onlyto_slughas callers. A workspace-wide grep finds zero callers offrom_title.Cost
Two names for the same conversion invite drift and force readers to check whether they differ.
Suggested fix
Delete
Slug::from_titleand keepTitle::to_slugas the single conversion.