use core::error::Error (#11317)

This commit is contained in:
Thomas Coratger
2024-09-29 18:47:48 +02:00
committed by GitHub
parent b8aeecae62
commit 55bf29e6d2
25 changed files with 90 additions and 101 deletions

View File

@ -305,7 +305,7 @@ pub fn write_json_file<T: Serialize>(path: &Path, obj: &T) -> Result<()> {
pub fn atomic_write_file<F, E>(file_path: &Path, write_fn: F) -> Result<()>
where
F: FnOnce(&mut File) -> std::result::Result<(), E>,
E: Into<Box<dyn std::error::Error + Send + Sync>>,
E: Into<Box<dyn core::error::Error + Send + Sync>>,
{
let mut tmp_path = file_path.to_path_buf();
tmp_path.set_extension("tmp");