mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-07-20 22:57:39 -04:00
Address _vec.grow FIXME, as issue #89 has been closed.
This commit is contained in:
+1
-4
@@ -68,15 +68,12 @@ fn slice[T](vec[T] v, int start, int end) -> vec[T] {
|
||||
ret result;
|
||||
}
|
||||
|
||||
// Ought to take mutable &vec[T] v and just mutate it instead of copy
|
||||
// and return. Blocking on issue #89 for this.
|
||||
fn grow[T](mutable vec[T] v, int n, &T initval) -> vec[T] {
|
||||
fn grow[T](&mutable vec[T] v, int n, &T initval) {
|
||||
let int i = n;
|
||||
while (i > 0) {
|
||||
i -= 1;
|
||||
v += vec(initval);
|
||||
}
|
||||
ret v;
|
||||
}
|
||||
|
||||
fn map[T,U](&op[T,U] f, &vec[T] v) -> vec[U] {
|
||||
|
||||
Reference in New Issue
Block a user