chore(dev): justfile (ядро) + CI-гейт (lint/test/deny) + rustfmt

just ci зелёный: fmt + clippy(-D warnings) + 6 unit-тестов common + cargo-deny.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
This commit is contained in:
2026-06-24 12:01:04 +03:00
parent b969d35b81
commit 54f17cbf4e
4 changed files with 67 additions and 3 deletions
+8 -2
View File
@@ -23,7 +23,10 @@ pub fn tmp_path(path: &Path) -> PathBuf {
/// Атомарно и durable записать `contents` в `path`.
pub fn write_atomic(path: &Path, contents: &[u8]) -> io::Result<()> {
let dir = path.parent().ok_or_else(|| {
io::Error::new(io::ErrorKind::InvalidInput, "путь без родительского каталога")
io::Error::new(
io::ErrorKind::InvalidInput,
"путь без родительского каталога",
)
})?;
let tmp = tmp_path(path);
@@ -61,7 +64,10 @@ mod tests {
write_atomic(&p, b"old").unwrap();
write_atomic(&p, b"new").unwrap();
assert_eq!(fs::read(&p).unwrap(), b"new");
assert!(!tmp_path(&p).exists(), "осиротевший .tmp не должен оставаться");
assert!(
!tmp_path(&p).exists(),
"осиротевший .tmp не должен оставаться"
);
}
// Целостность основного файла не зависит от постороннего .tmp (rename атомарен на одной ФС).