DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
chore: method paths for remaining trivial closures (Sonar S1612)
Dylan M. Taylor9770002c5c1d
diff --git a/crates/engine/src/cmd/datamerge/parse.rs b/crates/engine/src/cmd/datamerge/parse.rsindex c76c37f1e..741b66e67 100644--- a/crates/engine/src/cmd/datamerge/parse.rs+++ b/crates/engine/src/cmd/datamerge/parse.rs@@ -128,7 +128,7 @@ pub fn table_from_objects(rows: &[Value]) -> Result<Table, String> {warnings.push(format!("Row {} has an extra field \"{key}\". It was ignored.", i + 1));}}- if cells.iter().all(|c| c.is_empty()) {+ if cells.iter().all(String::is_empty) {continue;}out.push(cells);diff --git a/crates/idml/src/xml.rs b/crates/idml/src/xml.rsindex 374e70c7f..62b853368 100644--- a/crates/idml/src/xml.rs+++ b/crates/idml/src/xml.rs@@ -88,7 +88,7 @@ impl El {if let Some(v) = self.get(k) {return Some(v.to_string());}- self.prop_el(k).map(|e| e.text_content())+ self.prop_el(k).map(El::text_content)}pub fn prop_el(&self, k: &str) -> Option<&El> {self.find("Properties").and_then(|p| p.find(k))diff --git a/crates/textimport/src/xlsx.rs b/crates/textimport/src/xlsx.rsindex 83bea3c87..314dc9810 100644--- a/crates/textimport/src/xlsx.rs+++ b/crates/textimport/src/xlsx.rs@@ -173,7 +173,7 @@ pub fn records(bytes: &[u8], sheet: Option<&str>) -> Result<Vec<Vec<String>>, Imextra.push(v.clone());}}- if *r != header_row && row.iter().all(|c| c.is_empty()) && extra.is_empty() {+ if *r != header_row && row.iter().all(String::is_empty) && extra.is_empty() {continue;}row.extend(extra);