Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Refactors time conversion and path resolution APIs to use more idiomatic patterns, unify resolvers, and borrow Volume instead of moving.
- Replaced manual Windows FILETIME →
SystemTimeconversion with achrono-based implementation. - Introduced
PathResolvableEntrytrait and a genericPathResolver, consolidating MFT and USN logic and cache management. - Updated
MftandUsnJournalto borrowVolume, addedpretty_formathelpers, and adapted examples and README.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/time.rs | Switched to chrono for Windows FILETIME handling |
| src/path.rs | Unified path resolution under PathResolver, added generic trait |
| src/mft.rs | Changed Mft to borrow Volume and added pretty_format |
| src/journal.rs | Changed UsnJournal to borrow Volume, renamed and added helpers |
| src/lib.rs | Updated inline examples to pass &volume |
| examples/*.rs | Migrated examples to PathResolver and pretty_format |
| README.md | Updated usage snippets to new borrow-based APIs |
| Cargo.toml | Added chrono dependency |
Comments suppressed due to low confidence (5)
src/path.rs:11
- The code uses
NonZeroUsizeinnew_with_cachebut doesn’t import it. Adduse std::num::NonZeroUsize;to the imports.
use std::{
src/time.rs:25
- The function accepts
i64and casts negatives to largeu64values. Change the parameter tou64to accurately represent FILETIME intervals.
pub(crate) fn filetime_to_systemtime(filetime: i64) -> SystemTime {
src/path.rs:8
c_voidis imported but never used. Remove it to keep imports clean.
ffi::{OsString, c_void},
src/path.rs:66
- The doc mentions "drive letter" but the constructor only takes a
Volume. Update the comment to remove the drive letter reference.
/// Create a new `PathResolver` for a given NTFS/ReFs volume and drive letter.
src/path.rs:14
Foundationis imported but not referenced. Remove this to avoid unused imports.
Foundation::{self},
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.
No description provided.