These are chat archives for rust-lang/rust

18th
Nov 2018
laurent bernabé
@loloof64
Nov 18 2018 09:00
Hi everyone :smile: I tried to understand how to build an app with web-view crate (and Elm/PureScript probably), but I did not understand how the app must be generated or structured for the file-system. Even looking at Go original version. Probably going to give up this solution, and maybe cross-application gui in rust probably. As nothing seems as easy as with most common programming languages
Sackery
@sackery
Nov 18 2018 11:30
how serde_json serialize Result<Option<T>> to json?
Tim Robinson
@1tgr
Nov 18 2018 11:39
{"Ok":"hello"}
You can try it on play.rust-lang.org
extern crate serde_json; // 1.0.33

fn main() {
    let r: Result<Option<&str>, ()> = Ok(Some("hello"));
    println!("{}", serde_json::to_string(&r).unwrap())
}