@@ -289,10 +289,7 @@ impl PrivateForest {
289289 let mut salt = vec ! [ 0u8 ; 32 ] ;
290290 rand:: rngs:: OsRng . fill_bytes ( & mut salt) ;
291291
292- let now = std:: time:: SystemTime :: now ( )
293- . duration_since ( std:: time:: UNIX_EPOCH )
294- . unwrap_or_default ( )
295- . as_secs ( ) as i64 ;
292+ let now = crate :: time:: now_timestamp ( ) ;
296293
297294 let mut directories = HashMap :: new ( ) ;
298295 directories. insert ( "/" . to_string ( ) , ForestDirectoryEntry {
@@ -368,10 +365,7 @@ impl PrivateForest {
368365
369366 /// Update the modified timestamp
370367 fn touch ( & mut self ) {
371- self . modified_at = std:: time:: SystemTime :: now ( )
372- . duration_since ( std:: time:: UNIX_EPOCH )
373- . unwrap_or_default ( )
374- . as_secs ( ) as i64 ;
368+ self . modified_at = crate :: time:: now_timestamp ( ) ;
375369 }
376370
377371 /// Generate a storage key for a new file
@@ -1128,10 +1122,7 @@ impl ManifestRoot {
11281122 let mut shard_salt = vec ! [ 0u8 ; 32 ] ;
11291123 rand:: rngs:: OsRng . fill_bytes ( & mut shard_salt) ;
11301124
1131- let now = std:: time:: SystemTime :: now ( )
1132- . duration_since ( std:: time:: UNIX_EPOCH )
1133- . unwrap_or_default ( )
1134- . as_secs ( ) as i64 ;
1125+ let now = crate :: time:: now_timestamp ( ) ;
11351126
11361127 Self {
11371128 version : 7 ,
@@ -1356,10 +1347,7 @@ impl ShardManifestV7 {
13561347
13571348 /// Refresh the modified timestamp.
13581349 pub fn touch ( & mut self ) {
1359- self . root . modified_at = std:: time:: SystemTime :: now ( )
1360- . duration_since ( std:: time:: UNIX_EPOCH )
1361- . unwrap_or_default ( )
1362- . as_secs ( ) as i64 ;
1350+ self . root . modified_at = crate :: time:: now_timestamp ( ) ;
13631351 }
13641352
13651353 /// Total entries across all shards (O(num_shards), not O(N)).
0 commit comments