New to rust. Would like to understand why this issue is occuring and how to fix. I don't think I can change the signature for the implementation of the trait method either which makes this more harder to fix.
use std::ops::{AddAssign};
pub struct ColumnVector {
pub data: Vec<f32>
}
impl AddAssign for &ColumnVector {
fn add_assign(&mut self, other: Self) {
for (index, elem) in other.data.iter().enumerate() {
self.data[index] += elem;
}
}
}
fn main() {
}