Support returning Result type from async fn main
Closed this issue · 2 comments
teohhanhui commented
Seems like this is broken in 1.1.0:
#[smol_potat::main]
async fn main() -> anyhow::Result<()> {
error[E0308]: mismatched types
--> src/main.rs:129:20
|
128 | #[smol_potat::main]
| -------------------
| | |
| | help: consider removing this semicolon
| implicitly returns `()` as its body has no tail or `return` expression
129 | async fn main() -> anyhow::Result<()> {
| ^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()`
|
= note: expected enum `std::result::Result<(), anyhow::Error>`
found unit type `()`
There doesn't seem to be any tests for this?