News for hackers. Stuff that matters.
Re:Announcing Rust 1.0 Beta by phaylon on Friday April 03, 2015 @02:08PM (#9317409)
I would say it is familiarity, but in another sense. You can use something like

    path.file_name().and_then(|f| f.to_str()).unwrap()
but that really doesn't buy you much.

Where familiarity comes in I believe is in what that line communicates to me: There might not be a file name (like having '/' as path), and that getting a string slice out of it might fail (the kind of string the platform uses for paths might not be UTF-8 compatible).

Plus, the unwrap()s tell me that whoever wrote the code considered it an assertion failure if one of those is happening.

I read a lot more Rust than I write, and it really helps that the code communicates a lot. And with knowing about OsString/OsStr beforehand, I only had to lookup when file_name() returns None, the rest is rather implicit by convention, or familiarity.

Re:Announcing Rust 1.0 Beta by tikue_ on Friday April 03, 2015 @07:41PM (#9319235)
I wish `and_then` were named `flat_map` so badly.
Re:Announcing Rust 1.0 Beta by Manishearth on Saturday April 04, 2015 @01:30AM (#9320021)
We have `flat_map` for iterators. (`and_then` works for Options, which are basically nullables)

You can convert an Option to a zero-cost iterator and then use `flat_map` though.