ソースを参照

chore: cleanup todo

Lucas Nogueira 4 年 前
コミット
d79f03c449
1 ファイル変更2 行追加5 行削除
  1. 2 5
      tooling/bundler/src/bundle/updater_bundle.rs

+ 2 - 5
tooling/bundler/src/bundle/updater_bundle.rs

@@ -72,9 +72,6 @@ fn bundle_update(settings: &Settings, bundles: &[Bundle]) -> crate::Result<Vec<P
   let osx_archived = format!("{}.tar.gz", source_path.display());
   let osx_archived_path = PathBuf::from(&osx_archived);
 
-  // safe unwrap
-  //let tar_source = &source_path.parent().unwrap().to_path_buf();
-
   // Create our gzip file (need to send parent)
   // as we walk the source directory (source isnt added)
   create_tar(&source_path, &osx_archived_path)
@@ -220,11 +217,11 @@ fn create_tar_from_src<P: AsRef<Path>, W: Write>(src_dir: P, dest_file: W) -> cr
         continue;
       }
 
-      // todo(lemarier): better error catching
       // We add the .parent() because example if we send a path
       // /dev/src-tauri/target/debug/bundle/osx/app.app
       // We need a tar with app.app/<...> (source root folder should be included)
-      let dest_path = src_path.strip_prefix(&src_dir.parent().expect(""))?;
+      // safe to unwrap: the path has a parent
+      let dest_path = src_path.strip_prefix(&src_dir.parent().unwrap())?;
       if entry.file_type().is_dir() {
         tar_builder.append_dir(dest_path, src_path)?;
       } else {