Skip to content

Commit

Permalink
chore: Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
donovanglover committed Apr 7, 2024
1 parent 8dfd1d8 commit 48d3d75
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn out(mut stream: TcpStream, status: &str, contents: &str) {
/// Open an executable in wine
fn open(request: &str) -> Result<String, &'static str> {
let Ok(request) = decode(request) else {
return Err("The request was invalid.")
return Err("The request was invalid.");
};

println!("{}", request);
Expand All @@ -56,16 +56,17 @@ fn open(request: &str) -> Result<String, &'static str> {
let Ok(Output { stdout, stderr, .. }) = Command::new("wine")
.env("WINEPREFIX", split[1])
.arg(split[0])
.output() else {
return Err("Error while trying to run the wine command.")
};
.output()
else {
return Err("Error while trying to run the wine command.");
};

let Ok(stdout) = String::from_utf8(stdout) else {
return Err("The program returned invalid stdout.")
return Err("The program returned invalid stdout.");
};

let Ok(stderr) = String::from_utf8(stderr) else {
return Err("The program returned invalid stderr.")
return Err("The program returned invalid stderr.");
};

Ok(format!("stdout:\n{stdout}\nstderr:\n{stderr}"))
Expand Down

0 comments on commit 48d3d75

Please sign in to comment.