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 8 months ago
commit b0af48aa033166693fe9a985dd764db3cf2ffae8
parent 0200e84aeaa2a507b6037875413ef37763f485d5
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()) {