Skip to content

Commit 76e19c9

Browse files
committed
clippy
Signed-off-by: Moritz Hoffmann <[email protected]>
1 parent dc6c07a commit 76e19c9

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

src/interchange/src/envelopes.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ where
5252
let mut afters = vec![];
5353

5454
let mut cursor = batch.cursor();
55-
while cursor.key_valid(&batch) {
56-
let k = cursor.key(&batch);
55+
while cursor.key_valid(batch) {
56+
let k = cursor.key(batch);
5757

5858
// Partition updates into retractions (befores)
5959
// and insertions (afters).
60-
while cursor.val_valid(&batch) {
61-
let v = cursor.val(&batch);
62-
cursor.map_times(&batch, |t, diff| {
60+
while cursor.val_valid(batch) {
61+
let v = cursor.val(batch);
62+
cursor.map_times(batch, |t, diff| {
6363
let diff = Tr::owned_diff(diff);
6464
let update = (
6565
Tr::owned_time(t),
@@ -72,7 +72,7 @@ where
7272
afters.push(update);
7373
}
7474
});
75-
cursor.step_val(&batch);
75+
cursor.step_val(batch);
7676
}
7777

7878
// Sort by timestamp.
@@ -112,7 +112,7 @@ where
112112
session.give(((Tr::owned_key(k), group), t, Diff::ONE));
113113
}
114114

115-
cursor.step_key(&batch);
115+
cursor.step_key(batch);
116116
}
117117
}
118118
});

src/repr/src/row.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ mod columnar {
496496
fn extend_from_self(&mut self, other: Self::Borrowed<'_>, range: Range<usize>) {
497497
if !range.is_empty() {
498498
// Imported bounds will be relative to this starting offset.
499-
let values_len = self.values.len() as u64;
499+
let values_len: u64 = self.values.len().try_into().expect("must fit");
500500

501501
// Push all bytes that we can, all at once.
502502
let other_lower = if range.start == 0 {
@@ -505,8 +505,11 @@ mod columnar {
505505
other.bounds.index_as(range.start - 1)
506506
};
507507
let other_upper = other.bounds.index_as(range.end - 1);
508-
self.values
509-
.extend_from_self(other.values, other_lower as usize..other_upper as usize);
508+
self.values.extend_from_self(
509+
other.values,
510+
usize::try_from(other_lower).expect("must fit")
511+
..usize::try_from(other_upper).expect("must fit"),
512+
);
510513

511514
// Each bound needs to be shifted by `values_len - other_lower`.
512515
if values_len == other_lower {

src/repr/src/timestamp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ mod columnar_timestamp {
149149
impl columnar::Container for Timestamps<Vec<Timestamp>> {
150150
#[inline(always)]
151151
fn extend_from_self(&mut self, other: Self::Borrowed<'_>, range: Range<usize>) {
152-
self.0.extend_from_self(&other.0, range)
152+
self.0.extend_from_self(other.0, range)
153153
}
154154
#[inline(always)]
155155
fn reserve_for<'a, I>(&mut self, selves: I)

src/storage/examples/upsert_open_loop.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ async fn run_benchmark(
595595
upsert_stream.sink(
596596
Exchange::new(move |_| u64::cast_from(chosen_worker)),
597597
&format!("source-{source_id}-counter"),
598-
move |input| {
598+
move |(input, input_frontier)| {
599599
if !active_worker {
600600
return;
601601
}
@@ -611,7 +611,7 @@ async fn run_benchmark(
611611
}
612612
});
613613

614-
if input.frontier().is_empty() {
614+
if input_frontier.is_empty() {
615615
assert_eq!(num_records_total, num_additions);
616616
info!(
617617
"Processing source {source_id} finished \
@@ -621,9 +621,9 @@ async fn run_benchmark(
621621
);
622622
} else if PartialOrder::less_than(
623623
&frontier.borrow(),
624-
&input.frontier().frontier(),
624+
&input_frontier.frontier(),
625625
) {
626-
frontier = input.frontier().frontier().to_owned();
626+
frontier = input_frontier.frontier().to_owned();
627627
let data_timestamp = frontier.clone().into_option().unwrap();
628628
let elapsed = start.elapsed();
629629

@@ -916,7 +916,8 @@ where
916916
let mut upsert_op =
917917
AsyncOperatorBuilder::new(format!("source-{source_id}-upsert"), scope.clone());
918918

919-
let (output, output_stream): (_, Stream<_, (Vec<u8>, Vec<u8>, i32)>) = upsert_op.new_output();
919+
let (output, output_stream): (_, Stream<_, (Vec<u8>, Vec<u8>, i32)>) =
920+
upsert_op.new_output::<CapacityContainerBuilder<_>>();
920921
let mut input = upsert_op.new_input_for(
921922
source_stream,
922923
Exchange::new(|d: &(Vec<u8>, Vec<u8>)| d.0.hashed()),
@@ -1014,7 +1015,8 @@ where
10141015
let mut upsert_op =
10151016
AsyncOperatorBuilder::new(format!("source-{source_id}-upsert"), scope.clone());
10161017

1017-
let (output, output_stream): (_, Stream<_, (Vec<u8>, Vec<u8>, i32)>) = upsert_op.new_output();
1018+
let (output, output_stream): (_, Stream<_, (Vec<u8>, Vec<u8>, i32)>) =
1019+
upsert_op.new_output::<CapacityContainerBuilder<_>>();
10181020
let mut input = upsert_op.new_input_for(
10191021
source_stream,
10201022
Exchange::new(|d: &(Vec<u8>, Vec<u8>)| d.0.hashed()),

src/timely-util/benches/reclock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn bench_reclock_simple(c: &mut Criterion) {
105105
data_cap.downgrade(&Partitioned::new_singleton(0, ts - 1));
106106
}
107107
if ts.is_multiple_of(data_interval) {
108-
data.session(data_cap.clone()).give((
108+
data.activate().session(&data_cap).give((
109109
ts,
110110
Partitioned::new_singleton(0, ts),
111111
Diff::ONE,

0 commit comments

Comments
 (0)