How to make a macro_rule! like macro

macro_rules! fun {
    ($name:ident,$block:block) => {
        fn $name() -> Result<(),String>
            $block
    };
}
fun! {abc, {
     // ...
     Ok(())
    }
}

I want to simplify function writing by macro fun!, but found no way to implement a macro_rule! like macro, to be used as

fun! abc {
     // ...
     Ok(())
}

Is there any approach?

The second question is how to hide the Ok(()) ending into macro definition.

This is impossible. You have to use some delimiter (parentheses, brackets, braces).

It used to be possible to define foo! bar {} macros in some way (I think using the unstable compiler plugin api which has been almost entirely removed since, but supported for example a predecessor to proc macros), but since rustc 1.38.0 macro_rules! is a special case in the parser and anything else will give a syntax error.