Why is &Vec<T> used in function argument instead of &[T]? Example in this line, it also occurs in other places.
Why is &Vec<T> used in the trait Allocator instead of &[T]? Line
Does this mean this method can extend/shrink the last argument?
Are some types supposed to implement Copy? Like Addr which implements Copy but there are some clone operations.
That's a holdover from when I started this project. I was only beginning to learn Rust. I agree, there's no good reason not to pass a slice in those cases.
mark_var can push instructions into the last argument, yes.
Addr only recently implemented Copy. Consequently there are some still vestigial clone operations lying around.
OK and
Why is &Vec
used in the trait Allocator instead of &[T]?
But even for trait Allocator &Vec<T> doesn't seem required, &[T] seem better.
This seems to be a good first issue.
Yes, there's no reason to prefer &Vec to &[T].
Most helpful comment
That's a holdover from when I started this project. I was only beginning to learn Rust. I agree, there's no good reason not to pass a slice in those cases.
mark_varcan push instructions into the last argument, yes.Addronly recently implementedCopy. Consequently there are some still vestigial clone operations lying around.