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 e01814c408df42afc9ee6c7c6f88689466c69310
parent 6a1b13bb668a1bf59579150b12c63d816078a6fa
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()) {