def Vec.to_list
import bend-kit-collections@0.1.4.1/vec.bend as Vecimport Base
119# The elements, first to last.
120def Vec.to_list(~T: Data, v: Vec<T>) -> List<&2, T>:
121 match v:
122 case VNil{}:
123 Nil{}
124 case Vec{+n, buf}:
125 +last = (n - 1 : U32)
126 Vec.to_list.go(~T, U32.to_nat(n), last, Nil{}, Array.get(T, buf, last))