summaryrefslogtreecommitdiffhomepage
path: root/examples/rust/upload-reflector
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2025-05-14 20:37:16 +0100
committerAndrew Clayton <a.clayton@nginx.com>2025-05-14 20:37:16 +0100
commit89900c002afb77366503330b513c2547b6cf1abd (patch)
tree8ac51d78b1e91fea3cc3840706830c14bfc9dbc2 /examples/rust/upload-reflector
parenta7ca0088535ba2cfa898bacf54067517cda7ee7d (diff)
downloadunit-wasm-89900c002afb77366503330b513c2547b6cf1abd.tar.gz
unit-wasm-89900c002afb77366503330b513c2547b6cf1abd.tar.bz2
examples/rust: Remove some redundant unsafe blocks
... as noted by the compiler... Fixes: 2cf492f ("examples/rust: Fix some new rustc warnings") Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'examples/rust/upload-reflector')
-rw-r--r--examples/rust/upload-reflector/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/rust/upload-reflector/src/lib.rs b/examples/rust/upload-reflector/src/lib.rs
index 2f1992b..30afc8c 100644
--- a/examples/rust/upload-reflector/src/lib.rs
+++ b/examples/rust/upload-reflector/src/lib.rs
@@ -72,7 +72,7 @@ pub fn upload_reflector(ctx: *mut luw_ctx_t) -> i32 {
#[no_mangle]
pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 {
- let ctx: *mut luw_ctx_t = unsafe { addr_of_mut!(CTX) };
+ let ctx: *mut luw_ctx_t = addr_of_mut!(CTX);
if unsafe { REQUEST_BUF.is_null() } {
uwr_init_ctx(ctx, addr, 0 /* Response offset */);
@@ -87,7 +87,7 @@ pub extern "C" fn uwr_request_handler(addr: *mut u8) -> i32 {
*/
uwr_set_req_buf(
ctx,
- unsafe { addr_of_mut!(REQUEST_BUF) },
+ addr_of_mut!(REQUEST_BUF),
LUW_SRB_APPEND | LUW_SRB_ALLOC | LUW_SRB_FULL_SIZE,
);
} else {