These are chat archives for rust-lang/rust

11th
Dec 2018
Akos Vandra
@axos88
Dec 11 2018 00:18
no idea, this works for me
have been using it for months cant remember how i came up with it
Diego Antonio Rosario Palomino
@GunpowderGuy_gitlab
Dec 11 2018 13:37
is there any way to close a rust program prematurely , that does not result in a runtime error
Michal 'vorner' Vaner
@vorner
Dec 11 2018 13:38
@GunpowderGuy_gitlab std::process::exit?
Zakarum
@omni-viral
Dec 11 2018 14:12
^
John Hughes
@jondo2010
Dec 11 2018 19:00
Hi folks, question for the Serde enlightened: given struct S1 { field1: Vec<Rc<S2>> }. Is there a way that I can write a custom deserializer just for S2 or Rc<S2> and let derive(Deserialize) handle the rest?
Tim Robinson
@1tgr
Dec 11 2018 19:04
Yes, you can impl Deserialize for S2
Serde supports Rc but it won't attempt to share values on deserialization https://serde.rs/feature-flags.html#-features-rc
John Hughes
@jondo2010
Dec 11 2018 19:07
Cool, thanks
Ichoran
@Ichoran
Dec 11 2018 19:19
You have to be the one implementing S2 in order to impl Deserialize for it.
John Hughes
@jondo2010
Dec 11 2018 19:20
Thankfully it's from my own crate