chore: formatting

This commit is contained in:
Gabriele Musco 2023-06-09 20:17:27 +02:00
commit 0682071dbd
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE
2 changed files with 16 additions and 9 deletions

View file

@ -49,7 +49,12 @@ macro_rules! logger_thread {
if buf.is_empty() { if buf.is_empty() {
continue; continue;
} }
match $sender.clone().lock().expect("Could not lock sender").send(buf) { match $sender
.clone()
.lock()
.expect("Could not lock sender")
.send(buf)
{
Ok(_) => {} Ok(_) => {}
Err(_) => return, Err(_) => return,
}; };
@ -57,11 +62,15 @@ macro_rules! logger_thread {
}; };
} }
}) })
} };
} }
impl Runner { impl Runner {
pub fn new(environment: Option<HashMap<String, String>>, command: String, args: Vec<String>) -> Self { pub fn new(
environment: Option<HashMap<String, String>>,
command: String,
args: Vec<String>,
) -> Self {
let (sender, receiver) = sync_channel(64000); let (sender, receiver) = sync_channel(64000);
Self { Self {
environment: match environment { environment: match environment {
@ -179,10 +188,7 @@ mod tests {
runner.terminate(); runner.terminate();
assert_eq!(runner.status(), RunnerStatus::Stopped); assert_eq!(runner.status(), RunnerStatus::Stopped);
let out = runner.get_output(); let out = runner.get_output();
assert_eq!( assert_eq!(out, "REX2TEST: Lorem ipsum dolor\n");
out,
"REX2TEST: Lorem ipsum dolor\n"
);
} }
#[test] #[test]
@ -197,7 +203,9 @@ mod tests {
sleep(time::Duration::from_millis(10)); sleep(time::Duration::from_millis(10));
} }
runner.save_output("./target/testout/testlog".into()); runner
.save_output("./target/testout/testlog".into())
.expect("Failed to save output file");
} }
#[test] #[test]

View file

@ -1,4 +1,3 @@
pub mod main_win; pub mod main_win;
pub mod widgets; pub mod widgets;
pub mod styles; pub mod styles;