Skip to content

Commit cb4286d

Browse files
committed
Fix formatting
1 parent e12ff21 commit cb4286d

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

ascent/src/aggregators.rs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,19 @@ use std::ops::Add;
1717

1818
/// computes the minimum of the input column
1919
pub fn min<'a, N>(inp: impl Iterator<Item = (&'a N,)>) -> impl Iterator<Item = N>
20-
where
21-
N: Ord + Clone,
22-
N: 'a,
23-
{
20+
where N: 'a + Ord + Clone {
2421
inp.map(|tuple| tuple.0).min().cloned().into_iter()
2522
}
2623

2724
/// computes the maximum of the input column
2825
pub fn max<'a, N>(inp: impl Iterator<Item = (&'a N,)>) -> impl Iterator<Item = N>
29-
where
30-
N: Ord + Clone,
31-
N: 'a,
32-
{
26+
where N: 'a + Ord + Clone {
3327
inp.map(|tuple| tuple.0).max().cloned().into_iter()
3428
}
3529

3630
/// computes the sum of the input column
3731
pub fn sum<'a, N>(inp: impl Iterator<Item = (&'a N,)>) -> impl Iterator<Item = N>
38-
where
39-
N: Ord + Add + Clone + Sum<N>,
40-
N: 'a,
41-
{
32+
where N: 'a + Ord + Add + Clone + Sum<N> {
4233
let sum = inp.map(|tuple| tuple.0).cloned().sum::<N>();
4334
std::iter::once(sum)
4435
}
@@ -75,10 +66,7 @@ pub fn count(inp: impl Iterator<Item = ()>) -> impl Iterator<Item = usize> {
7566

7667
/// computes the average of the input column, returning an `f64`
7768
pub fn mean<'a, N>(inp: impl Iterator<Item = (&'a N,)>) -> impl Iterator<Item = f64>
78-
where
79-
N: Clone + Into<f64>,
80-
N: 'a,
81-
{
69+
where N: 'a + Clone + Into<f64> {
8270
let (sum, count) = inp.fold((0.0, 0usize), |(sum, count), tuple| (tuple.0.clone().into() + sum, count + 1));
8371
let res = if count == 0 { None } else { Some(sum / count as f64) };
8472
res.into_iter()
@@ -88,8 +76,7 @@ where
8876
pub fn percentile<'a, TItem, TInputIter>(p: f64) -> impl Fn(TInputIter) -> std::option::IntoIter<TItem>
8977
where
9078
TInputIter: Iterator<Item = (&'a TItem,)>,
91-
TItem: Ord + Clone,
92-
TItem: 'a,
79+
TItem: 'a + Ord + Clone,
9380
{
9481
move |inp| {
9582
let mut sorted: Vec<_> = inp.map(|tuple| tuple.0.clone()).collect();

ascent/src/rel_index_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub trait RelIndexRead<'a> {
1616
fn len_estimate(&'a self) -> usize;
1717

1818
/// Is the relation **definitely** empty?
19-
///
19+
///
2020
/// It is OK for implementations to return `false` even if the relation may be empty,
2121
/// as this is used to enable certain optimizations.
2222
fn is_empty(&'a self) -> bool { false }

ascent_macro/src/scratchpad.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)