Remove unnecessary -> () function return types

This commit is contained in:
Richard Feldman 2022-05-18 08:29:40 -04:00
parent 7a353f0e0c
commit 9c72e5e8ed
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
13 changed files with 26 additions and 26 deletions

View file

@ -318,7 +318,7 @@ impl {name} {{
r#"
/// Other `into_` methods return a payload, but since the {tag_name} tag
/// has no payload, this does nothing and is only here for completeness.
pub fn into_{tag_name}(self) -> () {{
pub fn into_{tag_name}(self) {{
()
}}"#,
)?;
@ -329,7 +329,7 @@ impl {name} {{
r#"
/// Other `as` methods return a payload, but since the {tag_name} tag
/// has no payload, this does nothing and is only here for completeness.
pub unsafe fn as_{tag_name}(&self) -> () {{
pub unsafe fn as_{tag_name}(&self) {{
()
}}"#,
)?;
@ -904,7 +904,7 @@ impl {name} {{
r#"
/// Other `into_` methods return a payload, but since the {null_tag} tag
/// has no payload, this does nothing and is only here for completeness.
pub fn into_{null_tag}(self) -> () {{
pub fn into_{null_tag}(self) {{
()
}}"#,
)?;
@ -915,7 +915,7 @@ impl {name} {{
r#"
/// Other `as` methods return a payload, but since the {null_tag} tag
/// has no payload, this does nothing and is only here for completeness.
pub unsafe fn as_{null_tag}(&self) -> () {{
pub unsafe fn as_{null_tag}(&self) {{
()
}}"#,
)?;

View file

@ -250,13 +250,13 @@ fn tag_union_aliased() {
/// Other `into_` methods return a payload, but since the Baz tag
/// has no payload, this does nothing and is only here for completeness.
pub fn into_Baz(self) -> () {
pub fn into_Baz(self) {
()
}
/// Other `as` methods return a payload, but since the Baz tag
/// has no payload, this does nothing and is only here for completeness.
pub unsafe fn as_Baz(&self) -> () {
pub unsafe fn as_Baz(&self) {
()
}
@ -586,13 +586,13 @@ fn cons_list_of_strings() {
/// Other `into_` methods return a payload, but since the Nil tag
/// has no payload, this does nothing and is only here for completeness.
pub fn into_Nil(self) -> () {
pub fn into_Nil(self) {
()
}
/// Other `as` methods return a payload, but since the Nil tag
/// has no payload, this does nothing and is only here for completeness.
pub unsafe fn as_Nil(&self) -> () {
pub unsafe fn as_Nil(&self) {
()
}
}
@ -708,13 +708,13 @@ fn cons_list_of_ints() {
/// Other `into_` methods return a payload, but since the Empty tag
/// has no payload, this does nothing and is only here for completeness.
pub fn into_Empty(self) -> () {
pub fn into_Empty(self) {
()
}
/// Other `as` methods return a payload, but since the Empty tag
/// has no payload, this does nothing and is only here for completeness.
pub unsafe fn as_Empty(&self) -> () {
pub unsafe fn as_Empty(&self) {
()
}
}

View file

@ -24,7 +24,7 @@ fn bench_group_wall_time(c: &mut Criterion) {
group.sample_size(nr_of_runs);
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<WallTime>>) -> ()> = vec![
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<WallTime>>)> = vec![
bench_nqueens, // queens 11
bench_cfold, // e = mkExpr 17 1
bench_deriv, // nest deriv 8 f

View file

@ -56,11 +56,11 @@ macro_rules! run_jit_function {
}
unsafe {
let main: libloading::Symbol<unsafe extern "C" fn(*mut RocCallResult<$ty>) -> ()> =
$lib.get($main_fn_name.as_bytes())
.ok()
.ok_or(format!("Unable to JIT compile `{}`", $main_fn_name))
.expect("errored");
let main: libloading::Symbol<unsafe extern "C" fn(*mut RocCallResult<$ty>)> = $lib
.get($main_fn_name.as_bytes())
.ok()
.ok_or(format!("Unable to JIT compile `{}`", $main_fn_name))
.expect("errored");
#[repr(C)]
struct Failures {

View file

@ -33,7 +33,7 @@ where
#[inline(always)]
pub fn with_larger_debug_stack<F>(run_test: F)
where
F: FnOnce() -> (),
F: FnOnce(),
F: Send,
F: 'static,
{

View file

@ -49,7 +49,7 @@ where
#[inline(always)]
pub fn with_larger_debug_stack<F>(run_test: F)
where
F: FnOnce() -> (),
F: FnOnce(),
F: Send,
F: 'static,
{

View file

@ -51,7 +51,7 @@ where
#[inline(always)]
pub fn with_larger_debug_stack<F>(run_test: F)
where
F: FnOnce() -> (),
F: FnOnce(),
F: Send,
F: 'static,
{

View file

@ -19,7 +19,7 @@ pub fn mono_test(_args: TokenStream, item: TokenStream) -> TokenStream {
let result = quote! {
#[test]
#(#attributes)*
#visibility fn #name(#args) -> () {
#visibility fn #name(#args) {
compiles_to_ir(#name_str, #body);
}

View file

@ -14,7 +14,7 @@ extern "C" {
// program
#[link_name = "roc__programForHost_1_exposed_generic"]
fn roc_program() -> ();
fn roc_program();
#[link_name = "roc__programForHost_size"]
fn roc_program_size() -> i64;

View file

@ -19,7 +19,7 @@ extern "C" {
fn roc_main_size() -> i64;
#[link_name = "roc__mainForHost_1_Fx_caller"]
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8) -> ();
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8);
#[allow(dead_code)]
#[link_name = "roc__mainForHost_1_Fx_size"]

View file

@ -10,13 +10,13 @@ use std::os::raw::c_char;
extern "C" {
#[link_name = "roc__mainForHost_1_exposed_generic"]
fn roc_main(output: *mut u8) -> ();
fn roc_main(output: *mut u8);
#[link_name = "roc__mainForHost_size"]
fn roc_main_size() -> i64;
#[link_name = "roc__mainForHost_1_Fx_caller"]
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8) -> ();
fn call_Fx(flags: *const u8, closure_data: *const u8, output: *mut u8);
#[allow(dead_code)]
#[link_name = "roc__mainForHost_1_Fx_size"]

View file

@ -13,7 +13,7 @@ fn bench_group(c: &mut Criterion<Perf>, hw_event_str: &str) {
// calculate statistics based on a fixed(flat) 100 runs
group.sampling_mode(SamplingMode::Flat);
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<Perf>>) -> ()> = vec![
let bench_funcs: Vec<fn(Option<&mut BenchmarkGroup<Perf>>)> = vec![
bench_nqueens,
bench_cfold,
bench_deriv,

View file

@ -82,7 +82,7 @@ where
#[inline(always)]
pub fn with_larger_debug_stack<F>(run_test: F)
where
F: FnOnce() -> (),
F: FnOnce(),
F: Send,
F: 'static,
{