Speed up brute force building with Prey.lock hashing and caching.
This commit is contained in:
@@ -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())?)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user