cargo clippy --fix

This commit is contained in:
2026-06-10 15:10:23 +03:00
parent cedeb89d2f
commit 8e5195d233
2 changed files with 43 additions and 49 deletions
+5 -11
View File
@@ -43,8 +43,7 @@ pub fn get_package_state(pkg: &rpm::Package) -> PackageState {
let child_stdout = child.stdout.take().expect("Couldn't take stdout"); let child_stdout = child.stdout.take().expect("Couldn't take stdout");
for line in BufReader::new(child_stdout).lines() { for line in BufReader::new(child_stdout).lines().flatten() {
if let Ok(line) = line {
let parts: Vec<&str> = line.split_whitespace().collect(); let parts: Vec<&str> = line.split_whitespace().collect();
if parts.len() != 3 { if parts.len() != 3 {
@@ -78,12 +77,11 @@ pub fn get_package_state(pkg: &rpm::Package) -> PackageState {
return PackageState::NewVersion(package_entry); return PackageState::NewVersion(package_entry);
} }
} }
}
child.kill().ok(); child.kill().ok();
child.wait().ok(); child.wait().ok();
return PackageState::NewPackage; PackageState::NewPackage
} }
pub fn dnf_start_action( pub fn dnf_start_action(
@@ -117,20 +115,16 @@ pub fn dnf_start_action(
let stdout_thread = thread::spawn(move || { let stdout_thread = thread::spawn(move || {
let stdout_lines = BufReader::new(child_stdout).lines(); let stdout_lines = BufReader::new(child_stdout).lines();
for line in stdout_lines { for line in stdout_lines.flatten() {
if let Ok(line) = line {
stdout_tx.send(line).ok(); stdout_tx.send(line).ok();
} }
}
}); });
let stderr_thread = thread::spawn(move || { let stderr_thread = thread::spawn(move || {
let stderr_lines = BufReader::new(child_stderr).lines(); let stderr_lines = BufReader::new(child_stderr).lines();
for line in stderr_lines { for line in stderr_lines.flatten() {
if let Ok(line) = line {
stderr_tx.send(line).ok(); stderr_tx.send(line).ok();
} }
}
}); });
while let Ok(None) = child.try_wait() { while let Ok(None) = child.try_wait() {
@@ -148,5 +142,5 @@ pub fn dnf_start_action(
child.wait().ok(); child.wait().ok();
}); });
return (action_thread, rx); (action_thread, rx)
} }
+7 -7
View File
@@ -62,7 +62,7 @@ impl Application {
let mut guard = pkg_state_shared.lock().unwrap(); let mut guard = pkg_state_shared.lock().unwrap();
*guard = Some(pkg_state); *guard = Some(pkg_state);
}); });
return thread; thread
} }
fn start_process(&mut self) { fn start_process(&mut self) {
@@ -105,7 +105,7 @@ impl Application {
} else { } else {
let mut value_layout_job = LayoutJob { let mut value_layout_job = LayoutJob {
wrap: TextWrapping { wrap: TextWrapping {
max_rows: max_rows, max_rows,
..Default::default() ..Default::default()
}, },
..Default::default() ..Default::default()
@@ -165,7 +165,7 @@ impl Application {
add_info_entry( add_info_entry(
ui, ui,
"Architecture", "Architecture",
&self.pkg.metadata.get_arch().unwrap_or("-"), self.pkg.metadata.get_arch().unwrap_or("-"),
1, 1,
false, false,
); );
@@ -179,28 +179,28 @@ impl Application {
add_info_entry( add_info_entry(
ui, ui,
"Summary ", "Summary ",
&self.pkg.metadata.get_summary().unwrap_or("-"), self.pkg.metadata.get_summary().unwrap_or("-"),
3, 3,
false, false,
); );
add_info_entry( add_info_entry(
ui, ui,
"URL ", "URL ",
&self.pkg.metadata.get_url().unwrap_or("-"), self.pkg.metadata.get_url().unwrap_or("-"),
1, 1,
true, true,
); );
add_info_entry( add_info_entry(
ui, ui,
"License ", "License ",
&self.pkg.metadata.get_license().unwrap_or("-"), self.pkg.metadata.get_license().unwrap_or("-"),
2, 2,
false, false,
); );
add_info_entry( add_info_entry(
ui, ui,
"Description ", "Description ",
&self.pkg.metadata.get_description().unwrap_or("-"), self.pkg.metadata.get_description().unwrap_or("-"),
5, 5,
false, false,
); );