I can't figure out how to handle Paths without resorting to nesting hell in this @rustlang snippet:
https://pastebin.com/jP6bwqe7
-
-
You could try doing an .and_then() chain on the nested Options https://doc.rust-lang.org/std/option/enum.Option.html#method.and_then … Also .is_some() / .is_none() might come in handy https://doc.rust-lang.org/std/option/enum.Option.html#method.is_some …
1 reply 0 retweets 3 likes
In general combinators (methods like these) are particularly useful to work through nested Options and Results. It's likely there's a combination of them that will squish your code to just a few lines in total (:
7:04 AM - 13 Mar 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.