News for hackers. Stuff that matters.
Re:Should small Rust structs be passed by-copy or by-borrow? by crave_ on Monday August 26, 2019 @10:13AM (#20800004)
This has irked me as well. Is there an acceptable way to make this less verbose?

A crate with a derive macro for example?

Re:Should small Rust structs be passed by-copy or by-borrow? by pornel on Monday August 26, 2019 @11:13AM (#20800513)
Re:Should small Rust structs be passed by-copy or by-borrow? by hcs on Monday August 26, 2019 @11:55AM (#20800858)
As danieldk mentioned elsewhere, you could get partway there with std::borrow::Borrow

    impl<T> Add<T> for &Vector3 where T: Borrow<Vector3>