Skip to content

Commit

Permalink
fixed clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jatin510 committed Nov 3, 2024
1 parent 588c7d6 commit 8f35562
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 6 additions & 4 deletions datafusion/physical-expr-common/src/sort_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,18 @@ pub struct LexOrdering {
pub inner: Vec<PhysicalSortExpr>,
}

impl AsRef<LexOrdering> for LexOrdering {
fn as_ref(&self) -> &LexOrdering {
self
}
}

impl LexOrdering {
// Creates a new [`LexOrdering`] from a vector
pub fn new(inner: Vec<PhysicalSortExpr>) -> Self {
Self { inner }
}

pub fn as_ref(&self) -> &LexOrdering {
self
}

pub fn capacity(&self) -> usize {
self.inner.capacity()
}
Expand Down
7 changes: 1 addition & 6 deletions datafusion/physical-expr/src/equivalence/ordering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@ impl OrderingEquivalenceClass {
/// Returns the concatenation of all the orderings. This enables merge
/// operations to preserve all equivalent orderings simultaneously.
pub fn output_ordering(&self) -> Option<LexOrdering> {
let output_ordering = self
.orderings
.iter()
.flat_map(|ordering| ordering.as_ref())
.cloned()
.collect();
let output_ordering = self.orderings.iter().flatten().cloned().collect();
let output_ordering = collapse_lex_ordering(output_ordering);
(!output_ordering.is_empty()).then_some(output_ordering)
}
Expand Down

0 comments on commit 8f35562

Please sign in to comment.