I am trying to implement -= operator between two u8 buffers, unfinished test code here:
use std::ops::SubAssign;
type Binbuf = Vec<u8>;
impl SubAssign for Binbuf {
fn sub_assign(&mut self, other: Self) {
self[self.len()-1] -= other[other.len()-1]
}
}
but it complains that I use existing types, does not even like the new one defined especially instead of Vec.
Apparently it expects all types to be entirely defined from scratch in the current crate and have no relationship whatsoever to any existing types? Any hints please how to resolve this simply, if it is at all possible?
The error message says:
impl doesn't use only types from inside the current crate