summaryrefslogtreecommitdiff
path: root/std/slice.zc
diff options
context:
space:
mode:
Diffstat (limited to 'std/slice.zc')
-rw-r--r--std/slice.zc9
1 files changed, 7 insertions, 2 deletions
diff --git a/std/slice.zc b/std/slice.zc
index 7ace396..c757fbd 100644
--- a/std/slice.zc
+++ b/std/slice.zc
@@ -28,8 +28,13 @@ impl SliceIter<T> {
}
impl Slice<T> {
- fn from_array(arr: T*, len: usize) -> Slice<T> {
- return Slice<T> { data: arr, len: len };
+ fn from_array(ptr: T*, len: usize) -> Slice<T> {
+ return Slice<T> { data: ptr, len: len };
+ }
+
+ // Alias for backwards compatibility with std/mem.zc
+ fn new(data: T*, len: usize) -> Slice<T> {
+ return Slice<T> { data: data, len: len };
}
fn iterator(self) -> SliceIter<T> {