Skip to content

Commit

Permalink
new clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Sep 15, 2021
1 parent a392cf0 commit 5349b4c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 34 deletions.
8 changes: 1 addition & 7 deletions polars/polars-core/src/datatypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,17 +549,11 @@ impl Field {
}
}

#[derive(Clone, Debug, PartialEq, Hash)]
#[derive(Clone, Debug, PartialEq, Hash, Default)]
pub struct Schema {
fields: Vec<Field>,
}

impl Default for Schema {
fn default() -> Self {
Schema { fields: vec![] }
}
}

impl Schema {
pub fn rename<I, J, T, S>(&self, old_names: I, new_names: J) -> Result<Schema>
where
Expand Down
7 changes: 1 addition & 6 deletions polars/polars-core/src/vector_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ impl AsU64 for [u8; 13] {
}
}

#[derive(Default)]
pub struct IdHasher {
hash: u64,
}
Expand Down Expand Up @@ -331,12 +332,6 @@ impl Hasher for IdHasher {
}
}

impl Default for IdHasher {
fn default() -> Self {
IdHasher { hash: 0 }
}
}

pub type IdBuildHasher = BuildHasherDefault<IdHasher>;

#[derive(Debug)]
Expand Down
11 changes: 1 addition & 10 deletions polars/polars-lazy/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,12 @@ impl IntoLazy for DataFrame {
/// Lazy abstraction over an eager `DataFrame`.
/// It really is an abstraction over a logical plan. The methods of this struct will incrementally
/// modify a logical plan until output is requested (via [collect](crate::frame::LazyFrame::collect))
#[derive(Clone)]
#[derive(Clone, Default)]
pub struct LazyFrame {
pub(crate) logical_plan: LogicalPlan,
pub(crate) opt_state: OptState,
}

impl Default for LazyFrame {
fn default() -> Self {
LazyFrame {
logical_plan: LogicalPlan::default(),
opt_state: Default::default(),
}
}
}

impl From<LogicalPlan> for LazyFrame {
fn from(plan: LogicalPlan) -> Self {
Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ use polars_core::datatypes::PlHashMap;
use polars_core::prelude::*;
use utils::*;

#[derive(Default)]
pub(crate) struct PredicatePushDown {}

impl Default for PredicatePushDown {
fn default() -> Self {
Self {}
}
}

impl PredicatePushDown {
fn apply_predicate(
&self,
Expand Down
1 change: 1 addition & 0 deletions polars/polars-lazy/src/physical_plan/executors/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ impl Executor for CsvExec {
.with_predicate(predicate)
.with_aggregate(aggregate)
.with_encoding(CsvEncoding::LossyUtf8)
.with_comment_char(self.options.comment_char)
.finish()?;

if self.options.cache {
Expand Down
6 changes: 1 addition & 5 deletions polars/polars-lazy/src/physical_plan/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ fn aggregate_expr_to_scan_agg(
.collect()
}

#[derive(Default)]
pub struct DefaultPlanner {}
impl Default for DefaultPlanner {
fn default() -> Self {
Self {}
}
}

impl PhysicalPlanner for DefaultPlanner {
fn create_physical_plan(
Expand Down

0 comments on commit 5349b4c

Please sign in to comment.