From 71ba509e6d662e1e8e703a7e1e609e1b1f8eb929 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Tue, 29 Aug 2023 23:51:39 +0100 Subject: examples/rust: Reduce the scope of an unsafe block in echo-request Signed-off-by: Andrew Clayton --- examples/rust/echo-request/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'examples') 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. -- cgit