[rust-dev] Bikeshed impl method extraction

Steven Blenkinsop steven099 at gmail.com
Sun Apr 29 23:08:27 PDT 2012

On Sunday, April 29, 2012, Gareth Smith wrote:

> Hi,
> I have written up some thoughts about a enabling a less repetitious API
> for constructing hashmaps (amongst other possibilities), here:
> https://github.com/mozilla/**rust/wiki/Bikeshed-impl-**method-extraction<https://github.com/mozilla/rust/wiki/Bikeshed-impl-method-extraction>
> Does this make any sense?

Couldn't you just do something like:

fn hashmap <K:hash equals copy, V:copy> () -> std::map::hashmap<K, V> {
    ret std::map::hashmap({|k| k.hash()}, {|k1,k2| k1.equals(k2)});

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20120430/ac1e5411/attachment.html>

More information about the Rust-dev mailing list