Skip to content

Commit

Permalink
use strip_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jul 15, 2023
1 parent 140fe81 commit 5b93859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ impl fmt::Display for AssociationExt {
impl<'d> serde::Deserialize<'d> for AssociationExt {
fn deserialize<D: Deserializer<'d>>(deserializer: D) -> Result<Self, D::Error> {
let ext = String::deserialize(deserializer)?;
if ext.starts_with('.') {
Ok(AssociationExt(ext.chars().skip(1).collect()))
if let Some(ext) = ext.strip_prefix('.') {
Ok(AssociationExt(ext.into()))
} else {
Ok(AssociationExt(ext))
}
Expand Down

0 comments on commit 5b93859

Please sign in to comment.