Skip to content

Commit 07e68d2

Browse files
authored
fix: parsing database kind is more permissive (#57)
1 parent fe8802a commit 07e68d2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

confik/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- Parsing of database kind is now case-insensitive.
56
- Minimum supported Rust version (MSRV) is now 1.67 due to `toml_edit` dependency.
67

78
## 0.11.0

confik/src/common.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ impl str::FromStr for DatabaseKind {
1616
type Err = MissingValue;
1717

1818
fn from_str(input: &str) -> Result<Self, Self::Err> {
19-
match input {
20-
"mysql" => Ok(Self::Mysql),
21-
"postgres" => Ok(Self::Postgres),
19+
match () {
20+
_ if input.eq_ignore_ascii_case("mysql") => Ok(Self::Mysql),
21+
_ if input.eq_ignore_ascii_case("postgres") => Ok(Self::Postgres),
2222
_ => Err(Self::Err::default()),
2323
}
2424
}

0 commit comments

Comments
 (0)