From 97e2fd88235a7861e5e737624ff6b0f4c87bb465 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Mon, 13 Apr 2026 22:46:02 +0100 Subject: [PATCH] Remove unnecessary Rust unit return type annotations --- rust/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/lib.rs b/rust/lib.rs index d80313d..0880239 100644 --- a/rust/lib.rs +++ b/rust/lib.rs @@ -10,7 +10,7 @@ fn say_hello(name: &str) { } #[unsafe(no_mangle)] -extern "C" fn hello(c: *const c_char) -> () { +extern "C" fn hello(c: *const c_char) { say_hello(unsafe { CStr::from_ptr(c) }.to_str().unwrap()) } @@ -22,7 +22,7 @@ struct T { } #[unsafe(no_mangle)] -extern "C" fn hello_struct(t: &T) -> () { +extern "C" fn hello_struct(t: &T) { say_hello(&format!("{:?}", t)) } @@ -34,7 +34,7 @@ enum Shape { } #[unsafe(no_mangle)] -extern "C" fn hello_shape(s: &Shape) -> () { +extern "C" fn hello_shape(s: &Shape) { say_hello(&format!("{:?}", s)) }