Skip to content

Commit

Permalink
use u64
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Feb 14, 2024
1 parent 95ab03d commit d954710
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions registry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ where
timestamp_ns: method
.id
.get_query_value("timestmap")?
.parse::<i64>()
.parse::<u64>()
.ok()?,
})
})
Expand All @@ -82,7 +82,9 @@ where
message: "Identities retrieved".to_string(),
installations: installations
.into_iter()
.filter(|i| i.timestamp_ns > start_time_ns)
// the only way an i64 cannot fit into a u64 if it's negative, so we can safely set
// to 0
.filter(|i| i.timestamp_ns > start_time_ns.try_into().unwrap_or(0))
.collect(),
})
}
Expand Down
2 changes: 1 addition & 1 deletion xps-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub struct InstallationId {
// installation id
pub id: Bytes,
/// Timestamp in nanoseconds of the block which the operation took place
pub timestamp_ns: i64,
pub timestamp_ns: u64,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
Expand Down

0 comments on commit d954710

Please sign in to comment.