mirror of
https://github.com/arabianq/rpmi.git
synced 2026-06-19 04:53:33 +00:00
fixed cargo clippy warnings
This commit is contained in:
+3
-3
@@ -43,7 +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().flatten() {
|
for line in BufReader::new(child_stdout).lines().map_while(Result::ok) {
|
||||||
let parts: Vec<&str> = line.split_whitespace().collect();
|
let parts: Vec<&str> = line.split_whitespace().collect();
|
||||||
|
|
||||||
if parts.len() != 3 {
|
if parts.len() != 3 {
|
||||||
@@ -115,14 +115,14 @@ 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.flatten() {
|
for line in stdout_lines.map_while(Result::ok) {
|
||||||
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.flatten() {
|
for line in stderr_lines.map_while(Result::ok) {
|
||||||
stderr_tx.send(line).ok();
|
stderr_tx.send(line).ok();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+2
-3
@@ -57,12 +57,11 @@ impl Application {
|
|||||||
fn get_package_state(&mut self) -> JoinHandle<()> {
|
fn get_package_state(&mut self) -> JoinHandle<()> {
|
||||||
let pkg_state_shared = self.pkg_state_shared.clone();
|
let pkg_state_shared = self.pkg_state_shared.clone();
|
||||||
let pkg = self.pkg.clone();
|
let pkg = self.pkg.clone();
|
||||||
let thread = thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
let pkg_state = get_package_state(&pkg);
|
let pkg_state = get_package_state(&pkg);
|
||||||
let mut guard = pkg_state_shared.lock().unwrap();
|
let mut guard = pkg_state_shared.lock().unwrap();
|
||||||
*guard = Some(pkg_state);
|
*guard = Some(pkg_state);
|
||||||
});
|
})
|
||||||
thread
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn start_process(&mut self) {
|
fn start_process(&mut self) {
|
||||||
|
|||||||
Reference in New Issue
Block a user