Remove unnecessary Rust unit return type annotations
This commit is contained in:
parent
4c9da46f22
commit
f83784592e
@ -10,7 +10,7 @@ fn say_hello(name: &str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
#[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())
|
say_hello(unsafe { CStr::from_ptr(c) }.to_str().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ struct T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
#[unsafe(no_mangle)]
|
||||||
extern "C" fn hello_struct(t: &T) -> () {
|
extern "C" fn hello_struct(t: &T) {
|
||||||
say_hello(&format!("{:?}", t))
|
say_hello(&format!("{:?}", t))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ enum Shape {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
#[unsafe(no_mangle)]
|
||||||
extern "C" fn hello_shape(s: &Shape) -> () {
|
extern "C" fn hello_shape(s: &Shape) {
|
||||||
say_hello(&format!("{:?}", s))
|
say_hello(&format!("{:?}", s))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user