Skip to content

Commit

Permalink
clippy is useful for once
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Oct 23, 2024
1 parent 18fdd6a commit ace8245
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/polars-core/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,12 @@ impl DataFrame {
if len != broadcast_len {
if len != 1 {
let name = col.name().to_owned();
let extra_info = if let Some(c) =
columns.iter().filter(|c| c.len() == broadcast_len).next()
{
format!(" (matching column '{}')", c.name())
} else {
String::new()
};
let extra_info =
if let Some(c) = columns.iter().find(|c| c.len() == broadcast_len) {
format!(" (matching column '{}')", c.name())
} else {
String::new()
};
polars_bail!(
ShapeMismatch: "could not create a new DataFrame: series {name:?} has length {len} while trying to broadcast to length {broadcast_len}{extra_info}",
);
Expand Down

0 comments on commit ace8245

Please sign in to comment.