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 b9400411aa8a242abc47be35f7429c552031f8d0
parent fb8b2cadb1b565f8ac75e13ac9c34ad647f1b859
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()) {