# HG changeset patch # User Yuya Nishihara # Date 1539520874 -7200 # Node ID c11d98cff8839b313500673780a6f9cd37deb122 # Parent e7af56a0733eea6aa202b6bf80b7863bc961b26e rust-chg: add brief comment about initial capacity of temp_sock_path() I don't know if it can be expressed as a compile-time constant, so it's a comment for now. About this series: This is quite old patches for rust-chg. I heard from Octobus people that there's a plan to do an experiment on merging hgcli + chg + some Rust?, so I decided to respin the rust-chg series. Maybe we'll rewrite the core to leverage the recent async/await functionality, but I want to first make my old patches in so the rust-chg can be a drop-in replacement for the chg of C. Compiler warnings will be removed later, and the codebase will be upgraded to the 2018 edition later. Differential Revision: https://phab.mercurial-scm.org/D8357 diff -r e7af56a0733e -r c11d98cff883 rust/chg/src/locator.rs --- a/rust/chg/src/locator.rs Wed Apr 01 14:34:21 2020 -0700 +++ b/rust/chg/src/locator.rs Sun Oct 14 14:41:14 2018 +0200 @@ -47,7 +47,7 @@ /// Temporary socket path for this client process. fn temp_sock_path(&self) -> PathBuf { let src = self.base_sock_path.as_os_str().as_bytes(); - let mut buf = Vec::with_capacity(src.len() + 6); + let mut buf = Vec::with_capacity(src.len() + 6); // "{src}.{pid}".len() buf.extend_from_slice(src); buf.extend_from_slice(format!(".{}", self.process_id).as_bytes()); OsString::from_vec(buf).into()