Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
apply cargo clippy --fix (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimexist authored Jan 11, 2022
1 parent 945ccdb commit 4b9c77a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl PyExecutionContext {
// generate a random (unique) name for this table
// table name cannot start with numeric digit
let name = "c".to_owned()
+ &Uuid::new_v4()
+ Uuid::new_v4()
.to_simple()
.encode_lower(&mut Uuid::encode_buffer());

Expand Down
8 changes: 4 additions & 4 deletions src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ impl PyNumberProtocol for PyExpr {
}

fn __mod__(lhs: PyExpr, rhs: PyExpr) -> PyResult<PyExpr> {
Ok(lhs.expr.clone().modulus(rhs.expr).into())
Ok(lhs.expr.modulus(rhs.expr).into())
}

fn __and__(lhs: PyExpr, rhs: PyExpr) -> PyResult<PyExpr> {
Ok(lhs.expr.clone().and(rhs.expr).into())
Ok(lhs.expr.and(rhs.expr).into())
}

fn __or__(lhs: PyExpr, rhs: PyExpr) -> PyResult<PyExpr> {
Ok(lhs.expr.clone().or(rhs.expr).into())
Ok(lhs.expr.or(rhs.expr).into())
}

fn __invert__(&self) -> PyResult<PyExpr> {
Expand Down Expand Up @@ -140,7 +140,7 @@ impl PyMappingProtocol for PyExpr {
fn __getitem__(&self, key: &str) -> PyResult<PyExpr> {
Ok(Expr::GetIndexedField {
expr: Box::new(self.expr.clone()),
key: ScalarValue::Utf8(Some(key.to_string()).to_owned()),
key: ScalarValue::Utf8(Some(key.to_string())),
}
.into())
}
Expand Down
6 changes: 2 additions & 4 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,11 @@ fn window(
expr: datafusion::logical_plan::Expr::WindowFunction {
fun,
args: args.into_iter().map(|x| x.expr).collect::<Vec<_>>(),
partition_by: partition_by
.unwrap_or(vec![])
partition_by: partition_by.unwrap_or_default()
.into_iter()
.map(|x| x.expr)
.collect::<Vec<_>>(),
order_by: order_by
.unwrap_or(vec![])
order_by: order_by.unwrap_or_default()
.into_iter()
.map(|x| x.expr)
.collect::<Vec<_>>(),
Expand Down
2 changes: 1 addition & 1 deletion src/udaf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl PyAggregateUDF {
volatility: &str,
) -> PyResult<Self> {
let function = logical_plan::create_udaf(
&name,
name,
input_type,
Arc::new(return_type),
parse_volatility(volatility)?,
Expand Down

0 comments on commit 4b9c77a

Please sign in to comment.