Skip to content

Commit 73d0914

Browse files
committed
examples/rust: Further simplify hello-world
In this example we don't need the request buf. Signed-off-by: Andrew Clayton <[email protected]>
1 parent 63e2d34 commit 73d0914

File tree

1 file changed

+0
-4
lines changed
  • examples/rust/hello-world/src

1 file changed

+0
-4
lines changed

examples/rust/hello-world/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ use unit_wasm::rusty::*;
1111
#[no_mangle]
1212
pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 {
1313
let ctx = &mut UWR_CTX_INITIALIZER();
14-
let mut request_buf: *mut u8 = std::ptr::null_mut();
1514

1615
uwr_init_ctx(ctx, addr, 4096);
17-
uwr_set_req_buf(ctx, &mut request_buf, LUW_SRB_ALLOC);
1816

1917
uwr_write_str!(
2018
ctx,
@@ -34,7 +32,5 @@ pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 {
3432
uwr_http_send_response(ctx);
3533
uwr_http_response_end();
3634

37-
uwr_free(request_buf);
38-
3935
return 0;
4036
}

0 commit comments

Comments
 (0)