forked from mirrors/jj
working_copy: drop open file instance from PersistError
For the same reason as the file_util change.
This commit is contained in:
parent
c6df0ba4c3
commit
ac99145a28
1 changed files with 6 additions and 4 deletions
|
@ -494,7 +494,7 @@ pub enum TreeStateError {
|
|||
#[error("Persisting tree state to file {path}: {source}")]
|
||||
PersistTreeState {
|
||||
path: PathBuf,
|
||||
source: tempfile::PersistError,
|
||||
source: std::io::Error,
|
||||
},
|
||||
#[error("Filesystem monitor error: {0}")]
|
||||
Fsmonitor(Box<dyn Error + Send + Sync>),
|
||||
|
@ -646,9 +646,11 @@ impl TreeState {
|
|||
let target_path = self.state_path.join("tree_state");
|
||||
temp_file
|
||||
.persist(&target_path)
|
||||
.map_err(|err| TreeStateError::PersistTreeState {
|
||||
path: target_path.clone(),
|
||||
source: err,
|
||||
.map_err(|tempfile::PersistError { error, file: _ }| {
|
||||
TreeStateError::PersistTreeState {
|
||||
path: target_path.clone(),
|
||||
source: error,
|
||||
}
|
||||
})?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue