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

I think it all depends on how your function is used in the end:

- if all you're doing is using the value with an added "?" for error handling, like "a = sqrt(b)?;" then Ok-wrapping is perfect, I love it.

- if you need to "match(check_credentials(user, pass)) {Privileges...}" then simply put, don't Ok-wrap and declare your function as usual.

Ok-wrapping sounds really good but shouldn't be used everywhere, like you still use "match" instead of "if let" sometimes. It'd be sad if this idea was aborted just because it's not universal.



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

Search: