It wasn't the cast that felt funny to me, it was the role of 0_u32 in the
expression. Its only purpose is to give access to the date impl over u32 which
is ok, but I'm used to having something like class methods for that.
Ted
On 2012-02-21, at 09:08, Marijn Haverbeke wrote:
>> let d = (0_u32 as date).from_str("2001-04-01");
>
> There's no reason to cast to an iface just to call a method on a
> value. 0_u32.from_str("...") should be equivalent.
>
> If you want to have different from_str constructor functions, though,
> just give them different names instead of using a kludge like this.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev