Base numeric types are implicitly clonable. For example, if you were mapping over a `&[int]` vector, for example, you would be able to do `.map(|x| *x)` and `x` would be implicitly cloned. For generic types like `T: Clone`, Rust complains because it thinks you are trying to move the value out of the vector, which is impossible. Therefore you must be explicit by calling `.clone()`.
~B☼ On 26/09/2013, at 7:11 AM, Thad Guidry <thadgui...@gmail.com> wrote: > wait a sec.. your cheating in the benchmark... > > Why did you clone() the array for theirs and not Lawrence's ? > > See here: https://gist.github.com/qznc/6704053#file-benchmark-L76 > > > > On Wed, Sep 25, 2013 at 4:07 PM, Thad Guidry <thadgui...@gmail.com> wrote: > > Apparently, the version of Scott Lawrence is the fastest one, unless I > made a mistake. > > > Longest code (and simplest to understand code)... FTW ! :) (as usual) > > -- > -Thad > Thad on Freebase.com > Thad on LinkedIn > > > > -- > -Thad > Thad on Freebase.com > Thad on LinkedIn > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev