mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-27 19:50:15 +03:00
fix clippy lints in nightly
This commit is contained in:
parent
dc06dadb10
commit
333ded9534
@ -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 }
|
@ -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<Option<Vec<String>>>
|
||||
|
||||
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<bool> {
|
||||
@ -90,7 +90,7 @@ pub fn is_conflicting(repository: &Repository, path: Option<&str>) -> Result<boo
|
||||
|
||||
let file = std::fs::File::open(conflicts_path)?;
|
||||
let reader = std::io::BufReader::new(file);
|
||||
let files = reader.lines().flatten().collect::<Vec<_>>();
|
||||
let files = reader.lines().map_while(Result::ok).collect::<Vec<_>>();
|
||||
if let Some(pathname) = path {
|
||||
// check if pathname is one of the lines in conflicts_path file
|
||||
for line in files {
|
||||
|
Loading…
Reference in New Issue
Block a user