Speed up brute force building with Prey.lock hashing and caching.

This commit is contained in:
Cutieguwu
2026-02-16 20:41:31 -05:00
parent 1009a84c06
commit f0d22e6b79
8 changed files with 170 additions and 92 deletions

View File

@@ -29,16 +29,16 @@ impl Nest {
}
}
pub fn write<P: AsRef<Path>>(&self, path: P) -> crate::Result<()> {
let mut path = path.as_ref().to_path_buf();
if path.is_dir() {
path = path.join(F_NEST_TOML);
pub fn write<P: AsRef<Path>>(&self, project_root: P) -> crate::Result<()> {
let mut project_root = project_root.as_ref().to_path_buf();
if project_root.is_dir() {
project_root = project_root.join(F_NEST_TOML);
}
Ok(OpenOptions::new()
.write(true)
.create(true)
.open(path)?
.open(project_root)?
.write_all(toml::to_string_pretty(&self)?.as_bytes())?)
}