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

Commit 4b9c77a

Browse files
authored
apply cargo clippy --fix (#15)
1 parent 945ccdb commit 4b9c77a

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl PyExecutionContext {
6767
// generate a random (unique) name for this table
6868
// table name cannot start with numeric digit
6969
let name = "c".to_owned()
70-
+ &Uuid::new_v4()
70+
+ Uuid::new_v4()
7171
.to_simple()
7272
.encode_lower(&mut Uuid::encode_buffer());
7373

src/expression.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ impl PyNumberProtocol for PyExpr {
6262
}
6363

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

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

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

7676
fn __invert__(&self) -> PyResult<PyExpr> {
@@ -140,7 +140,7 @@ impl PyMappingProtocol for PyExpr {
140140
fn __getitem__(&self, key: &str) -> PyResult<PyExpr> {
141141
Ok(Expr::GetIndexedField {
142142
expr: Box::new(self.expr.clone()),
143-
key: ScalarValue::Utf8(Some(key.to_string()).to_owned()),
143+
key: ScalarValue::Utf8(Some(key.to_string())),
144144
}
145145
.into())
146146
}

src/functions.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,11 @@ fn window(
119119
expr: datafusion::logical_plan::Expr::WindowFunction {
120120
fun,
121121
args: args.into_iter().map(|x| x.expr).collect::<Vec<_>>(),
122-
partition_by: partition_by
123-
.unwrap_or(vec![])
122+
partition_by: partition_by.unwrap_or_default()
124123
.into_iter()
125124
.map(|x| x.expr)
126125
.collect::<Vec<_>>(),
127-
order_by: order_by
128-
.unwrap_or(vec![])
126+
order_by: order_by.unwrap_or_default()
129127
.into_iter()
130128
.map(|x| x.expr)
131129
.collect::<Vec<_>>(),

src/udaf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl PyAggregateUDF {
133133
volatility: &str,
134134
) -> PyResult<Self> {
135135
let function = logical_plan::create_udaf(
136-
&name,
136+
name,
137137
input_type,
138138
Arc::new(return_type),
139139
parse_volatility(volatility)?,

0 commit comments

Comments
 (0)