From ace8245ee0d34efb015c797fa30f408cab9df29d Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Wed, 23 Oct 2024 14:50:19 +0200 Subject: [PATCH] clippy is useful for once --- crates/polars-core/src/frame/mod.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/polars-core/src/frame/mod.rs b/crates/polars-core/src/frame/mod.rs index d359dd3ab19c..f7248e0349d4 100644 --- a/crates/polars-core/src/frame/mod.rs +++ b/crates/polars-core/src/frame/mod.rs @@ -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}", );