Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
robherley committed Jan 18, 2025
1 parent 70fe00c commit 5921ea9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ async fn handle(mut body: web::Payload) -> Result<impl Responder, Error> {
}
}

let chunk = actix_web::web::Bytes::from(item);
if let Err(e) = body_tx.send(Ok(chunk)).await {
if let Err(e) = body_tx.send(Ok(item)).await {
warn!("unable to send chunk: {:?}", e);
break;
}
Expand All @@ -91,7 +90,7 @@ async fn handle(mut body: web::Payload) -> Result<impl Responder, Error> {
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
async fn main2() -> std::io::Result<()> {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info"))
.filter_module("wasmtime_wasi", log::LevelFilter::Warn)
.filter_module("tracing", log::LevelFilter::Warn)
Expand All @@ -108,3 +107,20 @@ async fn main() -> std::io::Result<()> {
.run()
.await
}

fn thing() -> Result<i32, Box<dyn std::error::Error>> {
return Ok(1);
}

fn main() {
let res = match foo() {
Ok(v) => v,
Err(e) => {
eprintln!("error: {}", e);
return err;
}
};

std::process::exit(res);
}
}
2 changes: 1 addition & 1 deletion src/streams/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl HostOutputStream for OutputStream {
return Ok(());
}

match self.tx.try_send(Bytes::from(buf)) {
match self.tx.try_send(buf) {
Ok(()) => Ok(()),
Err(err) => {
error!("failed to send chunk: {:?}", err);
Expand Down

0 comments on commit 5921ea9

Please sign in to comment.