فهرست منبع

Replace strip_prefix with replace

PatriotRossii 4 سال پیش
والد
کامیت
5743e6d8e3
1فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 2 3
      src/output/table.rs

+ 2 - 3
src/output/table.rs

@@ -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.strip_prefix(":").unwrap()
+                        file.replace(":", "")
                     } else {
                     } else {
-                        file.as_str()
+                        file
                     }
                     }
                 })
                 })
             }
             }