From 333ded953409547d4363c04d250ecaba9297e440 Mon Sep 17 00:00:00 2001 From: "josh@gitbutler.com" Date: Mon, 11 Dec 2023 11:09:27 +0100 Subject: [PATCH] fix clippy lints in nightly --- Cargo.toml | 1 + packages/tauri/src/project_repository/conflicts.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 01c4a6f25..5f1e0276d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -88,3 +88,4 @@ inconsistent_struct_constructor = { level = "allow", priority = 1 } match_wildcard_for_single_variants = { level = "allow", priority = 1 } unnested_or_patterns = { level = "allow", priority = 1 } similar_names = { level = "allow", priority = 1 } +struct_field_names = { level = "allow", priority = 1 } \ No newline at end of file diff --git a/packages/tauri/src/project_repository/conflicts.rs b/packages/tauri/src/project_repository/conflicts.rs index 54bba4c41..bf624c776 100644 --- a/packages/tauri/src/project_repository/conflicts.rs +++ b/packages/tauri/src/project_repository/conflicts.rs @@ -55,7 +55,7 @@ pub fn resolve(repository: &Repository, path: &str) -> Result<()> { let file = std::fs::File::open(conflicts_path.clone())?; let reader = std::io::BufReader::new(file); let mut remaining = Vec::new(); - for line in reader.lines().flatten() { + for line in reader.lines().map_while(Result::ok) { if line != path { remaining.push(line); } @@ -79,7 +79,7 @@ pub fn conflicting_files(repository: &Repository) -> Result>> let file = std::fs::File::open(conflicts_path)?; let reader = std::io::BufReader::new(file); - Ok(Some(reader.lines().flatten().collect())) + Ok(Some(reader.lines().map_while(Result::ok).collect())) } pub fn is_conflicting(repository: &Repository, path: Option<&str>) -> Result { @@ -90,7 +90,7 @@ pub fn is_conflicting(repository: &Repository, path: Option<&str>) -> Result>(); + let files = reader.lines().map_while(Result::ok).collect::>(); if let Some(pathname) = path { // check if pathname is one of the lines in conflicts_path file for line in files {