Skip to content

Commit dd81675

Browse files
committed
feat: impl From<String> for ChangeType
1 parent 718c4aa commit dd81675

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/versioning.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,17 @@ impl From<&str> for ChangeType {
148148
}
149149
}
150150

151+
impl From<String> for ChangeType {
152+
fn from(s: String) -> Self {
153+
match s.as_str() {
154+
"patch" => ChangeType::Patch,
155+
"minor" => ChangeType::Minor,
156+
"major" => ChangeType::Major,
157+
_ => ChangeType::Custom(s),
158+
}
159+
}
160+
}
161+
151162
impl Ord for ChangeType {
152163
fn cmp(&self, other: &Self) -> Ordering {
153164
match (self, other) {

0 commit comments

Comments
 (0)