Clippy code cleanup

This commit is contained in:
micialware committed 2026-08-15 13:22:59 +03:00
1 parent 9917702c4c
commit e676898135
22 files changed
+290 -171

No files matched your search

+9 -10
View File
@@ -63,7 +63,7 @@ pub enum ImportMessage {
impl NavigatedPage<ImportMessage> for ImportState {
fn navigate(&self, message: &ImportMessage) -> Option<Page> {
if let Some(_) = self.progress {
if self.progress.is_some() {
return None;
}
@@ -254,7 +254,7 @@ impl ImportState {
}
fn property_selector(&self) -> Element<'_, ImportMessage> {
if self.selected_property == None {
if self.selected_property.is_none() {
return space().into();
}
column![
@@ -360,7 +360,7 @@ impl ImportState {
spawn_blocking(move || {
Self::extract_import_file(path)?;
let data = Self::read_import_file()?;
return Ok(data);
Ok(data)
})
.await
.unwrap()
@@ -452,11 +452,11 @@ impl ImportState {
let mut word = WordData::new();
word.tags = import.tags.trim().replace(" ", ", ");
word.group_id = group_id.clone();
word.group_id = group_id;
for (dest, indices) in &map_indices {
let collected_string = Self::collect_strings(
&import.fields,
&indices,
indices,
&separator,
skip_empty,
);
@@ -525,15 +525,14 @@ impl ImportState {
}
fn collect_strings(
properties: &Vec<String>,
indices: &Vec<usize>,
properties: &[String],
indices: &[usize],
separator: &str,
skip_empty: bool,
) -> String {
let mut working_words = Vec::with_capacity(indices.len());
for i in 0..indices.len() {
let index = indices[i];
let str = properties.get(index).unwrap();
for index in indices {
let str = properties.get(*index).unwrap();
if skip_empty && str.is_empty() {
continue;
}