Hey Rustaceans! Got an easy question? Ask here (3/2018)!

I have this code which works: let timeasint = time.parse::<i64>().unwrap(); let timespec = time::Timespec::new(timeasint, 0); let utime = time::at_utc(timespec); let stime = utime.ctime();

I'd like to make it more consise, like: let stime = time.parse::<i64>().and_then(|t| time::at_utc(time::Timespec::new(t, 0))).ctime();

But, as you can see, I don't have a great grasp on this syntax. I get the error:

let stime = time.parse::<i64>().and_then(|t| time::at_utc(time::Timespec::new(t, 0))).ctime(); | expected enum std::result::Result, found struct time::Tm

Any hints?

/r/rust Thread