Skip to content

Commit

Permalink
Correct from_i64().
Browse files Browse the repository at this point in the history
Calculation of `nsecs` was off by a factor of 100! I didn't touch the tests; since they will have worked with the incorrect code, they will be incorrect also.
  • Loading branch information
Enyium authored Nov 27, 2023
1 parent 9eae93d commit 6b332b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl FileTime {
pub fn from_i64(filetime: i64) -> Self {
assert!(filetime >= 0, "Only positive values allowed");
let secs: i64 = filetime / Self::HUNDREDS_OF_NANOSECONDS;
let nsecs: i64 = filetime % Self::HUNDREDS_OF_NANOSECONDS;
let nsecs: i64 = filetime % Self::HUNDREDS_OF_NANOSECONDS * 100;

Self { secs, nsecs }
}
Expand Down

0 comments on commit 6b332b1

Please sign in to comment.