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");
for line in BufReader::new(child_stdout).lines() {
if let Ok(line) = line {
for line in BufReader::new(child_stdout).lines().flatten() {
let parts: Vec<&str> = line.split_whitespace().collect();
if parts.len() != 3 {
@@ -78,12 +77,11 @@ pub fn get_package_state(pkg: &rpm::Package) -> PackageState {
return PackageState::NewVersion(package_entry);
}
}
}
child.kill().ok();
child.wait().ok();
return PackageState::NewPackage;
PackageState::NewPackage
}
pub fn dnf_start_action(
@@ -117,20 +115,16 @@ pub fn dnf_start_action(
let stdout_thread = thread::spawn(move || {
let stdout_lines = BufReader::new(child_stdout).lines();
for line in stdout_lines {
if let Ok(line) = line {
for line in stdout_lines.flatten() {
stdout_tx.send(line).ok();
}
}
});
let stderr_thread = thread::spawn(move || {
let stderr_lines = BufReader::new(child_stderr).lines();
for line in stderr_lines {
if let Ok(line) = line {
for line in stderr_lines.flatten() {
stderr_tx.send(line).ok();
}
}
});
while let Ok(None) = child.try_wait() {
@@ -148,5 +142,5 @@ pub fn dnf_start_action(
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();
*guard = Some(pkg_state);
});
return thread;
thread
}
fn start_process(&mut self) {
@@ -105,7 +105,7 @@ impl Application {
} else {
let mut value_layout_job = LayoutJob {
wrap: TextWrapping {
max_rows: max_rows,
max_rows,
..Default::default()
},
..Default::default()
@@ -165,7 +165,7 @@ impl Application {
add_info_entry(
ui,
"Architecture",
&self.pkg.metadata.get_arch().unwrap_or("-"),
self.pkg.metadata.get_arch().unwrap_or("-"),
1,
false,
);
@@ -179,28 +179,28 @@ impl Application {
add_info_entry(
ui,
"Summary ",
&self.pkg.metadata.get_summary().unwrap_or("-"),
self.pkg.metadata.get_summary().unwrap_or("-"),
3,
false,
);
add_info_entry(
ui,
"URL ",
&self.pkg.metadata.get_url().unwrap_or("-"),
self.pkg.metadata.get_url().unwrap_or("-"),
1,
true,
);
add_info_entry(
ui,
"License ",
&self.pkg.metadata.get_license().unwrap_or("-"),
self.pkg.metadata.get_license().unwrap_or("-"),
2,
false,
);
add_info_entry(
ui,
"Description ",
&self.pkg.metadata.get_description().unwrap_or("-"),
self.pkg.metadata.get_description().unwrap_or("-"),
5,
false,
);