summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-08-29 23:51:39 +0100
committerAndrew Clayton <a.clayton@nginx.com>2023-08-29 23:51:39 +0100
commit71ba509e6d662e1e8e703a7e1e609e1b1f8eb929 (patch)
tree52e77e948ebb08d1833312bd2c55872aa2d3df25 /examples
parent04197e036a01d3826e0529f1396924a868bb4dd2 (diff)
downloadunit-wasm-71ba509e6d662e1e8e703a7e1e609e1b1f8eb929.tar.gz
unit-wasm-71ba509e6d662e1e8e703a7e1e609e1b1f8eb929.tar.bz2
examples/rust: Reduce the scope of an unsafe block in echo-request
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/rust/echo-request/src/lib.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/rust/echo-request/src/lib.rs b/examples/rust/echo-request/src/lib.rs
index 235ad13..d65cfb0 100644
--- a/examples/rust/echo-request/src/lib.rs
+++ b/examples/rust/echo-request/src/lib.rs
@@ -55,9 +55,7 @@ pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 {
uwr_init_ctx(ctx, addr, 4096);
// Set where we will copy the request into
- unsafe {
- uwr_set_req_buf(ctx, &mut REQUEST_BUF, LUW_SRB_NONE);
- }
+ uwr_set_req_buf(ctx, unsafe { &mut REQUEST_BUF }, LUW_SRB_NONE);
// Define the Response Body Text.