Skip to content

Commit 080a643

Browse files
authored
Fix write sources file path error message (#411)
1 parent e8fe114 commit 080a643

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

oma-mirror/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl MirrorManager {
296296
};
297297

298298
fs::write(path, result).context(WriteFileSnafu {
299-
path: self.apt_status_file.to_path_buf(),
299+
path: path.display().to_string(),
300300
})?;
301301

302302
Ok(())

oma-topics/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,9 @@ impl<'a> TopicManager<'a> {
331331
&self.atm_source_list_path
332332
};
333333

334-
tokio::fs::write(path, new_source_list).await.map_err(|e| {
335-
OmaTopicsError::FailedToOperateDirOrFile(
336-
self.atm_source_list_path.display().to_string(),
337-
e,
338-
)
339-
})?;
334+
tokio::fs::write(path, new_source_list)
335+
.await
336+
.map_err(|e| OmaTopicsError::FailedToOperateDirOrFile(path.display().to_string(), e))?;
340337

341338
Ok(())
342339
}

0 commit comments

Comments
 (0)