chore: merge tempfile functions - #302
Merged
Cedric / ViaDézo1er (viadezo1er) merged 1 commit intoAug 13, 2026
Merged
Conversation
Contributor
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
Cedric / ViaDézo1er (viadezo1er)
force-pushed
the
cedric/merge-tempfile-writers
branch
4 times, most recently
from
August 13, 2026 21:02
74fd955 to
6645f46
Compare
Was using both crate functions and reinventing the same functions
Cedric / ViaDézo1er (viadezo1er)
force-pushed
the
cedric/merge-tempfile-writers
branch
2 times, most recently
from
August 13, 2026 22:25
f13eaef to
bfc6b55
Compare
Cedric / ViaDézo1er (viadezo1er)
marked this pull request as ready for review
August 13, 2026 22:51
Cedric / ViaDézo1er (viadezo1er)
requested review from
Abhijeet Prasad (AbhiPrasad) and
Parker Henderson (parkerhendo)
August 13, 2026 22:53
Abhijeet Prasad (AbhiPrasad)
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We were both using the tempfile crate and reinventing what it does.
The reinvention has been removed. They were the only place where windows-sys was directly called, thus the Cargo.toml change.
AI summary:
The changes consolidate file-writing logic around shared atomic-write helpers in src/utils/fs_atomic.rs.
Main behavior changes
Call sites migrated
The shared helpers now write:
This removes several duplicated implementations that used fixed .tmp filenames or direct writes. Setup text files, previously written directly, are now atomic too.
Platform/dependency changes
Tests
Tests now cover:
One notable semantic difference is that the new common writer no longer explicitly calls sync_all() before persisting, unlike some of the
previous implementations. It protects against partial-file visibility, but provides weaker guarantees against sudden power loss.