Skip to content

Commit

Permalink
Updated toml dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBackx committed May 20, 2023
1 parent 72d8ff2 commit 629606c
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
63 changes: 61 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ crossbeam-utils = "0.8.15"
regex = "1.8"
serde = {version = "1.0.163", features = ["derive"]}
smithay-client-toolkit = "0.16.0"
toml = "0.5.11"
toml = "0.7.4"
tracing = "0.1.37"
tracing-subscriber = "0.3.17"
wayland-client = "0.29.5"
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ fn from_hex<'de, D>(deserializer: D) -> Result<u32, D::Error>
where
D: Deserializer<'de>,
{
let value: &str = Deserialize::deserialize(deserializer)?;
let value: String = Deserialize::deserialize(deserializer)?;
let re: Regex = Regex::new(r"^#[0-9a-fA-F]{6,8}$").unwrap();

if !re.is_match(value) {
if !re.is_match(&value) {
return Err(de::Error::invalid_value(
Unexpected::Str(value),
Unexpected::Str(&value),
&"a valid hex code",
));
}
Expand Down

0 comments on commit 629606c

Please sign in to comment.