We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96e6139 commit aea1f72Copy full SHA for aea1f72
[refs]
@@ -1,2 +1,2 @@
1
---
2
-refs/heads/master: 4fc72c21302d907a17affeaa4b72e114474410b0
+refs/heads/master: 9f7ed2f054c72dd0989b42ed3e6a839e64d9fa1a
trunk/src/lib/vec.rs
@@ -97,6 +97,11 @@ fn last<@T>(v: &[mutable? T]) -> option::t<T> {
97
ret some(v[len(v) - 1u]);
98
}
99
100
+/// Returns the last element of a non-empty vector `v`.
101
+fn last_total<@T>(v: &[mutable? T]) : is_not_empty(v) -> T {
102
+ ret v[len(v) - 1u];
103
+}
104
+
105
/// Returns a copy of the elements from [`start`..`end`) from `v`.
106
fn slice<@T>(v: &[mutable? T], start: uint, end: uint) -> [T] {
107
assert (start <= end);
0 commit comments