diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-06 10:23:55 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-01-06 17:40:05 +0100 |
| commit | 7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04 (patch) | |
| tree | 3b4781492ff8cb0458738f51ec9e601b5dee0d54 /src/libcore | |
| parent | 295df68faf1e881d7fda09406f47bb99ef7f4d43 (diff) | |
| download | rust-7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04.tar.gz rust-7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04.zip | |
Fix bug in method type parameter passing
It would occasionally pass the wrong type parameter, when calling a generic method from a generic impl on a bounded param type.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/vec.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 32bb2f46a49..11dcce00d4c 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -195,6 +195,16 @@ fn tail<T: copy>(v: [const T]) : is_not_empty(v) -> [T] { ret slice(v, 1u, len(v)); } +/* +Function tail_n + +Returns all but the first N elements of a vector +*/ + +fn tail_n<T: copy>(v: [const T], n: uint) -> [T] { + slice(v, n, len(v)) +} + // FIXME: This name is sort of confusing next to init_fn, etc // but this is the name haskell uses for this function, // along with head/tail/last. |
