4 ms·
Some of your criticisms are good and valid, but > Sorting out what was returned requires a "match" statement, which is rather verbose is particularly low qual
by dbaupp 12y ago
Some of your criticisms are good and valid, but
> Sorting out what was returned requires a "match" statement, which is rather verbose
is particularly low quality: even the code you quote above demonstrates (or at least hints) that this isn't true. `Option` provides a variety of combinator methods that avoid the need for manual pattern matching: http://doc.rust-lang.org/nightly/std/option/enum.Option.html http://doc.rust-lang.org/nightly/std/option/enum.Option.html
Also, this isn't extremely true either:
> Note that none of this code does any computation. It's all field access and update
Doesn't accessing fields and updating them count as computation? Anyway, nothing in date/time handling is just field access and updating; time libraries are hard (and I'm very happy that lifthrasiir is tackling it, their libraries are always high-quality and diligently written). There's actual "real" computation happening, you can see this looking at the underlying implementation: https://github.com/lifthrasiir/rust-chrono/blob/cf5e2f322fbc77cc9a15a18ab57fe615fdab138b/src/naive/date.rs#L341 https://github.com/lifthrasiir/rust-chrono/blob/cf5e2f322fbc... (and tracking those functions calls through inside that module).