Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
To not allocate in good case
Matthias Beyer committed 9 months ago
commit 6b4a75e498cf2abeaba9cac29a0fb4b2b72c7a74
parent 01bed73a60ab429c3f90a90bdc31a138ed54c78e
1 file changed +1 -1
modified crates/radicle-cli/src/commands/clone.rs
@@ -244,7 +244,7 @@ impl Checkout {
        let proj = doc
            .project()
            .map_err(|err| CheckoutFailure::Payload { rid, err })?;
-
        let path = directory.unwrap_or(Path::new(proj.name()).to_path_buf());
+
        let path = directory.unwrap_or_else(|| PathBuf::from(proj.name()));
        // N.b. fail if the path exists and is not empty
        if path.exists() {
            if path.read_dir().map_or(true, |mut dir| dir.next().is_some()) {