OliverFM / rust_light

A tensor processing library in rust.
MIT License
3 stars 0 forks source link

Convert indexing to use slices not vecs #20

Open OliverFM opened 1 year ago

OliverFM commented 1 year ago

This is generically better, but it may run into some annoying lifetime problems. And example error:

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
  --> src/tensor/tensor_like.rs:27:26
   |
27 |     fn get(&self, index: &Vec<usize>) -> Result<&Self::Elem, String>;
   |                          ^^^^^^^^^^^ help: change this to: `&[usize]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
   = note: `#[warn(clippy::ptr_arg)]` on by default