Yes, currently doing something similar to that, but I'd much rather have it as a first-citizen feature. Returning result directly from main sounds very interesting! I will have to look into that thx.
EDIT: I assume you mean RFC1937? Looks like it isn't implemented yet, so we will probably have to at least another year before we can get it in stable rust. But yes - without having read the entire RFC - I think that was what I was looking for!
Re:Elixir at PagerDuty
by steveklabnik on Thursday June 14, 2018 @04:43PM
(#17315205)
Part of it is implemented; see https://play.rust-lang.org/?gist=d442c47833587ddeff2158492b0...
The rest of it makes it even better; it's a bit limited in ways right now.
Oh nice! Will start using that as soon as we get to 1.26 :) -- currently stuck on 1.24 (upgrading takes a bunch of work since we're building under openembedded/bitbake, so I wait until the new version hits the upstream layer)
Re:Elixir at PagerDuty
by steveklabnik on Thursday June 14, 2018 @05:16PM
(#17315450)
Great! :D
I believe that in a recent stable version of Rust, you can make this even simpler and have `main()` return a Result directly.
edit: not quite as simple as I described, but maybe more powerful because of the Termination trait: https://github.com/rust-lang/rfcs/blob/master/text/1937-ques... see: https://github.com/rust-lang/rfcs/blob/master/text/1937-ques...