Skip to content

Commit 25dcc60

Browse files
Remove use of borrow_as from trace wrappers (#609)
1 parent a9874d3 commit 25dcc60

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

differential-dataflow/src/trace/wrappers/freeze.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use timely::progress::frontier::AntichainRef;
2626
use crate::operators::arrange::Arranged;
2727
use crate::trace::{TraceReader, BatchReader, Description};
2828
use crate::trace::cursor::Cursor;
29-
use crate::IntoOwned;
3029

3130
/// Freezes updates to an arrangement using a supplied function.
3231
///
@@ -78,7 +77,7 @@ where
7877
type Key<'a> = Tr::Key<'a>;
7978
type Val<'a> = Tr::Val<'a>;
8079
type Time = Tr::Time;
81-
type TimeGat<'a> = Tr::TimeGat<'a>;
80+
type TimeGat<'a> = &'a Tr::Time;
8281
type Diff = Tr::Diff;
8382
type DiffGat<'a> = Tr::DiffGat<'a>;
8483

@@ -141,7 +140,7 @@ where
141140
type Key<'a> = B::Key<'a>;
142141
type Val<'a> = B::Val<'a>;
143142
type Time = B::Time;
144-
type TimeGat<'a> = B::TimeGat<'a>;
143+
type TimeGat<'a> = &'a B::Time;
145144
type Diff = B::Diff;
146145
type DiffGat<'a> = B::DiffGat<'a>;
147146

@@ -185,7 +184,7 @@ where
185184
type Key<'a> = C::Key<'a>;
186185
type Val<'a> = C::Val<'a>;
187186
type Time = C::Time;
188-
type TimeGat<'a> = C::TimeGat<'a>;
187+
type TimeGat<'a> = &'a C::Time;
189188
type Diff = C::Diff;
190189
type DiffGat<'a> = C::DiffGat<'a>;
191190

@@ -204,7 +203,7 @@ where
204203
let func = &self.func;
205204
self.cursor.map_times(storage, |time, diff| {
206205
if let Some(time) = func(time) {
207-
logic(<Self::TimeGat<'_> as IntoOwned>::borrow_as(&time), diff);
206+
logic(&time, diff);
208207
}
209208
})
210209
}
@@ -240,7 +239,7 @@ where
240239
type Key<'a> = C::Key<'a>;
241240
type Val<'a> = C::Val<'a>;
242241
type Time = C::Time;
243-
type TimeGat<'a> = C::TimeGat<'a>;
242+
type TimeGat<'a> = &'a C::Time;
244243
type Diff = C::Diff;
245244
type DiffGat<'a> = C::DiffGat<'a>;
246245

@@ -259,7 +258,7 @@ where
259258
let func = &self.func;
260259
self.cursor.map_times(&storage.batch, |time, diff| {
261260
if let Some(time) = func(time) {
262-
logic(<Self::TimeGat<'_> as IntoOwned>::borrow_as(&time), diff);
261+
logic(&time, diff);
263262
}
264263
})
265264
}

differential-dataflow/src/trace/wrappers/frontier.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<Tr: TraceReader> TraceReader for TraceFrontier<Tr> {
3535
type Key<'a> = Tr::Key<'a>;
3636
type Val<'a> = Tr::Val<'a>;
3737
type Time = Tr::Time;
38-
type TimeGat<'a> = Tr::TimeGat<'a>;
38+
type TimeGat<'a> = &'a Tr::Time;
3939
type Diff = Tr::Diff;
4040
type DiffGat<'a> = Tr::DiffGat<'a>;
4141

@@ -86,7 +86,7 @@ impl<B: BatchReader> BatchReader for BatchFrontier<B> {
8686
type Key<'a> = B::Key<'a>;
8787
type Val<'a> = B::Val<'a>;
8888
type Time = B::Time;
89-
type TimeGat<'a> = B::TimeGat<'a>;
89+
type TimeGat<'a> = &'a B::Time;
9090
type Diff = B::Diff;
9191
type DiffGat<'a> = B::DiffGat<'a>;
9292

@@ -131,7 +131,7 @@ impl<C: Cursor> Cursor for CursorFrontier<C, C::Time> {
131131
type Key<'a> = C::Key<'a>;
132132
type Val<'a> = C::Val<'a>;
133133
type Time = C::Time;
134-
type TimeGat<'a> = C::TimeGat<'a>;
134+
type TimeGat<'a> = &'a C::Time;
135135
type Diff = C::Diff;
136136
type DiffGat<'a> = C::DiffGat<'a>;
137137

@@ -156,7 +156,7 @@ impl<C: Cursor> Cursor for CursorFrontier<C, C::Time> {
156156
time.clone_onto(&mut temp);
157157
temp.advance_by(since);
158158
if !until.less_equal(&temp) {
159-
logic(<Self::TimeGat<'_> as IntoOwned>::borrow_as(&temp), diff);
159+
logic(&temp, diff);
160160
}
161161
})
162162
}
@@ -194,7 +194,7 @@ impl<C: Cursor<Storage: BatchReader>> Cursor for BatchCursorFrontier<C> {
194194
type Key<'a> = C::Key<'a>;
195195
type Val<'a> = C::Val<'a>;
196196
type Time = C::Time;
197-
type TimeGat<'a> = C::TimeGat<'a>;
197+
type TimeGat<'a> = &'a C::Time;
198198
type Diff = C::Diff;
199199
type DiffGat<'a> = C::DiffGat<'a>;
200200

@@ -219,7 +219,7 @@ impl<C: Cursor<Storage: BatchReader>> Cursor for BatchCursorFrontier<C> {
219219
time.clone_onto(&mut temp);
220220
temp.advance_by(since);
221221
if !until.less_equal(&temp) {
222-
logic(<Self::TimeGat<'_> as IntoOwned>::borrow_as(&temp), diff);
222+
logic(&temp, diff);
223223
}
224224
})
225225
}

0 commit comments

Comments
 (0)