sarah-quinones / faer-rs

Linear algebra foundation for the Rust programming language
https://faer-rs.github.io
MIT License
1.82k stars 61 forks source link

clone_from for Mat #146

Closed 8000thCube closed 1 month ago

8000thCube commented 1 month ago

I noticed while messing around with object pools that the current implementation of Clone for Mat leaves the clone_from method to the default implementation. A custom implementation of this function that avoids an extra memory allocation in some generic cases (such as a smart pointer with a handle to an object pool implementing clone by drawing an object from the pool and then using clone_from) should be relatively simple.