Store only clock::Local in InsertionFragment

This commit is contained in:
Antonio Scandurra 2021-12-09 09:21:52 +01:00
parent dc81b5f57a
commit b7535dfba4
2 changed files with 4 additions and 4 deletions

View File

@ -636,7 +636,7 @@ impl Buffer {
.insertions
.get(
&InsertionFragmentKey {
timestamp: fragment.insertion_timestamp,
timestamp: fragment.insertion_timestamp.local(),
split_offset: fragment.insertion_offset,
},
&(),

View File

@ -410,14 +410,14 @@ struct FragmentTextSummary {
#[derive(Eq, PartialEq, Clone, Debug)]
struct InsertionFragment {
timestamp: InsertionTimestamp,
timestamp: clock::Local,
split_offset: usize,
fragment_id: Locator,
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
struct InsertionFragmentKey {
timestamp: InsertionTimestamp,
timestamp: clock::Local,
split_offset: usize,
}
@ -2178,7 +2178,7 @@ impl sum_tree::KeyedItem for InsertionFragment {
impl InsertionFragment {
fn new(fragment: &Fragment) -> Self {
Self {
timestamp: fragment.insertion_timestamp,
timestamp: fragment.insertion_timestamp.local(),
split_offset: fragment.insertion_offset,
fragment_id: fragment.id.clone(),
}