Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>I also sometimes include log statements in specific error branches for debugging and delete them afterwards. That's trivially possible in the Go version but requires more effort in the shorter variants

You can just map your logging in between:

foo().map_err(|e| {log(e); e}).bar()



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: