Replace strip_prefix with replace

This commit is contained in:
PatriotRossii 2021-03-24 19:05:38 +05:00 committed by GitHub
parent 57cf0f1b23
commit 5743e6d8e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,10 +298,9 @@ fn determine_time_zone() -> TZResult<TimeZone> {
} else { } else {
format!("/usr/share/zoneinfo/{}", { format!("/usr/share/zoneinfo/{}", {
if file.starts_with(":") { if file.starts_with(":") {
// Unwrap is panic-free here because we've checked if file starts with colon file.replace(":", "")
file.strip_prefix(":").unwrap()
} else { } else {
file.as_str() file
} }
}) })
} }