Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dadepo committed Apr 18, 2024
1 parent 8694f04 commit 50e9804
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ pub(crate) fn get_value_at(
) -> anyhow::Result<serde_json::Value> {
let path = JsonPath::parse(path)?;
path.query(&json)
.exactly_one()
.map(|json| json.clone())
.exactly_one().cloned()
.map_err(|err| anyhow!(err))
}

Expand Down
32 changes: 16 additions & 16 deletions src/postgres/math_udfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ mod tests {
let df = ctx.sql("select acosd(0.5) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -466,7 +466,7 @@ mod tests {
let df = ctx.sql("select acosd(0.4) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand Down Expand Up @@ -494,7 +494,7 @@ mod tests {
let df = ctx.sql("select cosd(60) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -507,7 +507,7 @@ mod tests {
let df = ctx.sql("select cosd(0.4) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -526,7 +526,7 @@ mod tests {
let df = ctx.sql("select cotd(45) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -535,7 +535,7 @@ mod tests {
let df = ctx.sql("select cotd(0.4) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -555,7 +555,7 @@ mod tests {

let batches = df.clone().collect().await?;

let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -564,7 +564,7 @@ mod tests {
let df = ctx.sql("select asind(0.4) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -583,7 +583,7 @@ mod tests {
let df = ctx.sql("select sind(30) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -596,7 +596,7 @@ mod tests {
let df = ctx.sql("select sind(0.4) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -615,7 +615,7 @@ mod tests {
let df = ctx.sql("select atand(0.5) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -628,7 +628,7 @@ mod tests {
let df = ctx.sql("select atand(1) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -643,7 +643,7 @@ mod tests {
let df = ctx.sql("select tand(45) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -656,7 +656,7 @@ mod tests {
let df = ctx.sql("select tand(0.4) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -675,7 +675,7 @@ mod tests {
let df = ctx.sql("select ceiling(12.2) as col_result").await?;

let batches = df.clone().collect().await?;
let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_float64_array(columns)?;
let result = result.value(0);

Expand All @@ -691,7 +691,7 @@ mod tests {

let batches = df.clone().collect().await?;

let columns = &batches.get(0).unwrap().column(0);
let columns = &batches.first().unwrap().column(0);
let result = as_int64_array(columns)?;
let result = result.value(0);

Expand Down

0 comments on commit 50e9804

Please sign in to comment.