Skip to content

Commit ae9073c

Browse files
committed
clean-up
1 parent d8c855e commit ae9073c

File tree

18 files changed

+124
-130
lines changed

18 files changed

+124
-130
lines changed

dogsdogsdogs/src/operators/lookup_map.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ where
3131
G::Timestamp: Lattice,
3232
Tr: TraceReader<Time=G::Timestamp>+Clone+'static,
3333
Tr::KeyOwned: Hashable,
34-
// Tr::Key: Ord+Hashable+Sized,
35-
// Tr::Val: Clone,
3634
Tr::Diff: Monoid+ExchangeData,
3735
F: FnMut(&D, &mut Tr::KeyOwned)+Clone+'static,
3836
D: ExchangeData,

examples/cursors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ where
139139
Tr::ValOwned: Debug + Clone,
140140
Tr::Time: Debug + Clone,
141141
Tr::Diff: Debug + Clone,
142-
<Tr::Cursor as Cursor>::ValOwned: Debug,
143142
{
144143
let (mut cursor, storage) = trace.cursor();
145144
for ((k, v), diffs) in cursor.to_vec(&storage).iter() {

examples/spines.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ fn main() {
3030
let (keys_input, keys) = scope.new_collection::<String, isize>();
3131

3232
match mode.as_str() {
33-
// "new" => {
34-
// use differential_dataflow::trace::implementations::ord_neu::ColKeySpine;
35-
// let data = data.arrange::<ColKeySpine<_,_,_>>();
36-
// let keys = keys.arrange::<ColKeySpine<_,_,_>>();
37-
// keys.join_core(&data, |_k, &(), &()| Option::<()>::None)
38-
// .probe_with(&mut probe);
39-
// },
40-
// "old" => {
41-
// use differential_dataflow::trace::implementations::ord_neu::OrdKeySpine;
42-
// let data = data.arrange::<OrdKeySpine<_,_,_>>();
43-
// let keys = keys.arrange::<OrdKeySpine<_,_,_>>();
44-
// keys.join_core(&data, |_k, &(), &()| Option::<()>::None)
45-
// .probe_with(&mut probe);
46-
// },
33+
"new" => {
34+
use differential_dataflow::trace::implementations::ord_neu::ColKeySpine;
35+
let data = data.arrange::<ColKeySpine<_,_,_>>();
36+
let keys = keys.arrange::<ColKeySpine<_,_,_>>();
37+
keys.join_core(&data, |_k, &(), &()| Option::<()>::None)
38+
.probe_with(&mut probe);
39+
},
40+
"old" => {
41+
use differential_dataflow::trace::implementations::ord_neu::OrdKeySpine;
42+
let data = data.arrange::<OrdKeySpine<_,_,_>>();
43+
let keys = keys.arrange::<OrdKeySpine<_,_,_>>();
44+
keys.join_core(&data, |_k, &(), &()| Option::<()>::None)
45+
.probe_with(&mut probe);
46+
},
4747
// "rhh" => {
4848
// use differential_dataflow::trace::implementations::rhh::{HashWrapper, VecSpine};
4949
// let data = data.map(|x| HashWrapper { inner: x }).arrange::<VecSpine<_,(),_,_>>();

src/operators/arrange/arrangement.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ where
128128
Tr::Diff: 'static,
129129
G::Timestamp: Clone+'static,
130130
TInner: Refines<G::Timestamp>+Lattice+Timestamp+Clone+'static,
131-
F: for <'b> FnMut(Tr::Key<'b>, Tr::Val<'b>, &G::Timestamp)->TInner+Clone+'static,
131+
F: FnMut(Tr::Key<'_>, Tr::Val<'_>, &G::Timestamp)->TInner+Clone+'static,
132132
P: FnMut(&TInner)->Tr::Time+Clone+'static,
133133
{
134134
let logic1 = logic.clone();
@@ -175,7 +175,7 @@ where
175175
where
176176
Tr::Diff: 'static,
177177
G::Timestamp: Clone+'static,
178-
F: for<'a> FnMut(Tr::Key<'a>, Tr::Val<'a>)->bool+Clone+'static,
178+
F: FnMut(Tr::Key<'_>, Tr::Val<'_>)->bool+Clone+'static,
179179
{
180180
let logic1 = logic.clone();
181181
let logic2 = logic.clone();
@@ -192,7 +192,7 @@ where
192192
pub fn as_collection<D: Data, L>(&self, mut logic: L) -> Collection<G, D, Tr::Diff>
193193
where
194194
Tr::Diff: Semigroup,
195-
L: for<'a> FnMut(Tr::Key<'a>, Tr::Val<'a>) -> D+'static,
195+
L: FnMut(Tr::Key<'_>, Tr::Val<'_>) -> D+'static,
196196
{
197197
self.flat_map_ref(move |key, val| Some(logic(key,val)))
198198
}
@@ -206,7 +206,7 @@ where
206206
Tr::Diff: Semigroup,
207207
I: IntoIterator,
208208
I::Item: Data,
209-
L: for<'a> FnMut(Tr::Key<'a>, Tr::Val<'a>) -> I+'static,
209+
L: FnMut(Tr::Key<'_>, Tr::Val<'_>) -> I+'static,
210210
{
211211
Self::flat_map_batches(&self.stream, logic)
212212
}
@@ -223,7 +223,7 @@ where
223223
Tr::Diff: Semigroup,
224224
I: IntoIterator,
225225
I::Item: Data,
226-
L: for<'a> FnMut(Tr::Key<'a>, Tr::Val<'a>) -> I+'static,
226+
L: FnMut(Tr::Key<'_>, Tr::Val<'_>) -> I+'static,
227227
{
228228
stream.unary(Pipeline, "AsCollection", move |_,_| move |input, output| {
229229
input.for_each(|time, data| {

src/operators/count.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ where G::Timestamp: TotalOrder+Lattice+Ord {
5555
}
5656
}
5757

58-
impl<G: Scope, K, T1> CountTotal<G, K, T1::Diff> for Arranged<G, T1>
58+
impl<G: Scope, T1> CountTotal<G, T1::KeyOwned, T1::Diff> for Arranged<G, T1>
5959
where
6060
G::Timestamp: TotalOrder+Lattice+Ord,
61-
T1: for<'a> TraceReader<Key<'a>=&'a K, Val<'a>=&'a (), Time=G::Timestamp>+Clone+'static,
62-
K: ExchangeData,
61+
T1: for<'a> TraceReader<Val<'a>=&'a (), Time=G::Timestamp>+Clone+'static,
62+
T1::KeyOwned: ExchangeData,
6363
T1::Diff: ExchangeData+Semigroup,
6464
{
65-
fn count_total_core<R2: Semigroup + From<i8>>(&self) -> Collection<G, (K, T1::Diff), R2> {
65+
fn count_total_core<R2: Semigroup + From<i8>>(&self) -> Collection<G, (T1::KeyOwned, T1::Diff), R2> {
6666

6767
let mut trace = self.trace.clone();
6868
let mut buffer = Vec::new();
@@ -74,6 +74,7 @@ where
7474

7575
move |input, output| {
7676

77+
use trace::cursor::MyTrait;
7778
input.for_each(|capability, batches| {
7879
batches.swap(&mut buffer);
7980
let mut session = output.session(&capability);
@@ -97,14 +98,14 @@ where
9798

9899
if let Some(count) = count.as_ref() {
99100
if !count.is_zero() {
100-
session.give(((key.clone(), count.clone()), time.clone(), R2::from(-1i8)));
101+
session.give(((key.into_owned(), count.clone()), time.clone(), R2::from(-1i8)));
101102
}
102103
}
103104
count.as_mut().map(|c| c.plus_equals(diff));
104105
if count.is_none() { count = Some(diff.clone()); }
105106
if let Some(count) = count.as_ref() {
106107
if !count.is_zero() {
107-
session.give(((key.clone(), count.clone()), time.clone(), R2::from(1i8)));
108+
session.give(((key.into_owned(), count.clone()), time.clone(), R2::from(1i8)));
108109
}
109110
}
110111
});

src/operators/join.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ impl<G, K, V, T1> JoinCore<G, K, V, T1::Diff> for Arranged<G,T1>
357357
G: Scope,
358358
G::Timestamp: Lattice+Ord,
359359
T1: for<'a> TraceReader<Key<'a> = &'a K, Val<'a> = &'a V, Time=G::Timestamp>+Clone+'static,
360-
K: Ord+'static + ?Sized,
361-
V: Ord+'static + ?Sized,
360+
K: Ord+'static,
361+
V: Ord+'static,
362362
T1::Diff: Semigroup,
363363
{
364364
fn join_core<Tr2,I,L>(&self, other: &Arranged<G,Tr2>, mut result: L) -> Collection<G,I::Item,<T1::Diff as Multiply<Tr2::Diff>>::Output>
@@ -796,7 +796,7 @@ where
796796
}
797797
}
798798

799-
fn think<'b, F: FnMut(C1::Val<'a>,C2::Val<'a>,C1::Time,&C1::Diff,&C2::Diff)>(&'b mut self, mut results: F) {
799+
fn think<F: FnMut(C1::Val<'a>,C2::Val<'a>,C1::Time,&C1::Diff,&C2::Diff)>(&mut self, mut results: F) {
800800

801801
// for reasonably sized edits, do the dead-simple thing.
802802
if self.history1.edits.len() < 10 || self.history2.edits.len() < 10 {

src/operators/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ struct ValueHistory<'storage, C: Cursor> where C::Time: Sized, C::Diff: Sized {
9191

9292
impl<'storage, C: Cursor> ValueHistory<'storage, C>
9393
where
94-
// C::Val: Ord+'storage,
9594
C::Time: Lattice+Ord+Clone,
9695
C::Diff: Semigroup,
9796
{
@@ -136,7 +135,7 @@ where
136135
}
137136

138137
/// Organizes history based on current contents of edits.
139-
fn replay<'history>(&'history mut self) -> HistoryReplay<'storage, 'history, C> where 'storage: 'history {
138+
fn replay<'history>(&'history mut self) -> HistoryReplay<'storage, 'history, C> {
140139

141140
self.buffer.clear();
142141
self.history.clear();
@@ -164,7 +163,6 @@ struct HistoryReplay<'storage, 'history, C>
164163
where
165164
'storage: 'history,
166165
C: Cursor,
167-
// C::Val: Ord+'storage,
168166
C::Time: Lattice+Ord+Clone+'history,
169167
C::Diff: Semigroup+'history,
170168
{
@@ -175,13 +173,12 @@ impl<'storage, 'history, C> HistoryReplay<'storage, 'history, C>
175173
where
176174
'storage: 'history,
177175
C: Cursor,
178-
// C::Val: Ord+'storage,
179176
C::Time: Lattice+Ord+Clone+'history,
180177
C::Diff: Semigroup+'history,
181178
{
182179
fn time(&self) -> Option<&C::Time> { self.replay.history.last().map(|x| &x.0) }
183180
fn meet(&self) -> Option<&C::Time> { self.replay.history.last().map(|x| &x.1) }
184-
fn edit<'s>(&'s self) -> Option<(C::Val<'storage>, &'s C::Time, &'s C::Diff)> {
181+
fn edit(&self) -> Option<(C::Val<'storage>, &C::Time, &C::Diff)> {
185182
self.replay.history.last().map(|&(ref t, _, v, e)| (self.replay.edits.values[v].0, t, &self.replay.edits.edits[e].1))
186183
}
187184

src/trace/cursor/cursor_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<C: Cursor> Cursor for CursorList<C> {
130130
self.minimize_keys(storage);
131131
}
132132
#[inline]
133-
fn seek_key<'a>(&mut self, storage: &Vec<C::Storage>, key: Self::Key<'a>) {
133+
fn seek_key(&mut self, storage: &Vec<C::Storage>, key: Self::Key<'_>) {
134134
for index in 0 .. self.cursors.len() {
135135
self.cursors[index].seek_key(&storage[index], key);
136136
}
@@ -146,7 +146,7 @@ impl<C: Cursor> Cursor for CursorList<C> {
146146
self.minimize_vals(storage);
147147
}
148148
#[inline]
149-
fn seek_val<'a>(&mut self, storage: &Vec<C::Storage>, val: Self::Val<'a>) {
149+
fn seek_val(&mut self, storage: &Vec<C::Storage>, val: Self::Val<'_>) {
150150
for &index in self.min_key.iter() {
151151
self.cursors[index].seek_val(&storage[index], val);
152152
}

src/trace/cursor/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub trait Cursor {
102102
/// Advances the cursor to the next key.
103103
fn step_key(&mut self, storage: &Self::Storage);
104104
/// Advances the cursor to the specified key.
105-
fn seek_key<'a>(&mut self, storage: &Self::Storage, key: Self::Key<'a>);
105+
fn seek_key(&mut self, storage: &Self::Storage, key: Self::Key<'_>);
106106
/// Convenience method to get access by reference to an owned key.
107107
fn seek_key_owned<'a>(&mut self, storage: &Self::Storage, key: &'a Self::KeyOwned) {
108108
self.seek_key(storage, <Self::Key<'a> as MyTrait<'a>>::borrow_as(key));
@@ -111,7 +111,7 @@ pub trait Cursor {
111111
/// Advances the cursor to the next value.
112112
fn step_val(&mut self, storage: &Self::Storage);
113113
/// Advances the cursor to the specified value.
114-
fn seek_val<'a>(&mut self, storage: &Self::Storage, val: Self::Val<'a>);
114+
fn seek_val(&mut self, storage: &Self::Storage, val: Self::Val<'_>);
115115

116116
/// Rewinds the cursor to the first key.
117117
fn rewind_keys(&mut self, storage: &Self::Storage);

src/trace/implementations/ord.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ where
363363
fn step_key(&mut self, storage: &OrdValBatch<L>){ self.cursor.step(&storage.layer); }
364364
fn seek_key(&mut self, storage: &OrdValBatch<L>, key: &Self::Key) { self.cursor.seek(&storage.layer, key); }
365365
fn step_val(&mut self, storage: &OrdValBatch<L>) { self.cursor.child.step(&storage.layer.vals); }
366-
fn seek_val<'a>(&mut self, storage: &OrdValBatch<L>, val: Self::Val<'a>) { self.cursor.child.seek(&storage.layer.vals, val); }
366+
fn seek_val(&mut self, storage: &OrdValBatch<L>, val: Self::Val<'a>) { self.cursor.child.seek(&storage.layer.vals, val); }
367367
fn rewind_keys(&mut self, storage: &OrdValBatch<L>) { self.cursor.rewind(&storage.layer); }
368368
fn rewind_vals(&mut self, storage: &OrdValBatch<L>) { self.cursor.child.rewind(&storage.layer.vals); }
369369
}

0 commit comments

Comments
 (0)