Skip to content

Commit cecae53

Browse files
committed
Simplify constraints
1 parent 986680c commit cecae53

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

differential-dataflow/examples/columnar.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ fn main() {
2323
worker: timely::WorkerConfig::default(),
2424
};
2525

26-
let keys: usize = std::env::args().nth(1).unwrap().parse().unwrap();
27-
let size: usize = std::env::args().nth(2).unwrap().parse().unwrap();
26+
let keys: usize = std::env::args().nth(1).expect("missing argument 1").parse().unwrap();
27+
let size: usize = std::env::args().nth(2).expect("missing argument 2").parse().unwrap();
2828

2929
let timer1 = ::std::time::Instant::now();
3030
let timer2 = timer1.clone();
@@ -411,7 +411,7 @@ pub mod batcher {
411411
D: for<'b> Columnar<Ref<'b>: Ord>,
412412
T: for<'b> Columnar<Ref<'b>: Ord>,
413413
R: for<'b> Columnar<Ref<'b>: Ord> + for<'b> Semigroup<R::Ref<'b>>,
414-
C2: Container + for<'b> PushInto<&'b (D, T, R)>,
414+
C2: Container + for<'b, 'c> PushInto<(D::Ref<'b>, T::Ref<'b>, &'c R)>,
415415
{
416416
fn push_into(&mut self, container: &'a mut Column<(D, T, R)>) {
417417

@@ -482,7 +482,12 @@ pub mod batcher {
482482
head: usize,
483483
}
484484

485-
impl<D: Ord + Columnar, T: Ord + Columnar, R: Columnar> ContainerQueue<Column<(D, T, R)>> for ColumnQueue<(D, T, R)> {
485+
impl<D, T, R> ContainerQueue<Column<(D, T, R)>> for ColumnQueue<(D, T, R)>
486+
where
487+
D: for<'a> Columnar<Ref<'a>: Ord>,
488+
T: for<'a> Columnar<Ref<'a>: Ord>,
489+
R: Columnar,
490+
{
486491
fn next_or_alloc(&mut self) -> Result<<(D, T, R) as Columnar>::Ref<'_>, Column<(D, T, R)>> {
487492
if self.is_empty() {
488493
Err(std::mem::take(&mut self.list))
@@ -499,11 +504,6 @@ pub mod batcher {
499504
let (data1, time1, _) = self.peek();
500505
let (data2, time2, _) = other.peek();
501506

502-
let data1 = <D as Columnar>::into_owned(data1);
503-
let data2 = <D as Columnar>::into_owned(data2);
504-
let time1 = <T as Columnar>::into_owned(time1);
505-
let time2 = <T as Columnar>::into_owned(time2);
506-
507507
(data1, time1).cmp(&(data2, time2))
508508
}
509509
fn from(list: Column<(D, T, R)>) -> Self {
@@ -524,17 +524,15 @@ pub mod batcher {
524524

525525
impl<D, T, R> MergerChunk for Column<(D, T, R)>
526526
where
527-
D: Ord + Columnar + 'static,
528-
T: Ord + timely::PartialOrder + Clone + Columnar + 'static,
529-
for<'a> <T as Columnar>::Ref<'a> : Copy,
527+
D: Columnar + 'static,
528+
T: timely::PartialOrder + Clone + Columnar + 'static,
530529
R: Default + Semigroup + Columnar + 'static
531530
{
532531
type TimeOwned = T;
533532
type DiffOwned = R;
534533

535534
fn time_kept((_, time, _): &Self::Item<'_>, upper: &AntichainRef<Self::TimeOwned>, frontier: &mut Antichain<Self::TimeOwned>) -> bool {
536535
let time = T::into_owned(*time);
537-
// let time = unimplemented!();
538536
if upper.less_equal(&time) {
539537
frontier.insert(time);
540538
true

0 commit comments

Comments
 (0)