Эх сурвалжийг харах

Use slice indexing rather than Iterator::skip.

This is an alternate fix for #101.
Simon Sapin 11 жил өмнө
parent
commit
f0f1bb9e82
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/lib.rs

+ 1 - 1
src/lib.rs

@@ -994,7 +994,7 @@ fn file_url_path_to_pathbuf(path: &[String]) -> Result<PathBuf, ()> {
         return Err(())
     }
     let mut string = prefix.to_string();
-    for path_part in path.iter().skip(1) {
+    for path_part in &path[1..] {
         string.push('\\');
 
         // Currently non-unicode windows paths cannot be represented