Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit 71ba509

Browse files
committed
examples/rust: Reduce the scope of an unsafe block in echo-request
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 04197e0 commit 71ba509

File tree

1 file changed

+1
-3
lines changed
  • examples/rust/echo-request/src

1 file changed

+1
-3
lines changed

examples/rust/echo-request/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 {
5555
uwr_init_ctx(ctx, addr, 4096);
5656

5757
// Set where we will copy the request into
58-
unsafe {
59-
uwr_set_req_buf(ctx, &mut REQUEST_BUF, LUW_SRB_NONE);
60-
}
58+
uwr_set_req_buf(ctx, unsafe { &mut REQUEST_BUF }, LUW_SRB_NONE);
6159

6260
// Define the Response Body Text.
6361

0 commit comments

Comments
 (0)