Skip to content

Commit aea1f72

Browse files
committed
---
yaml --- r: 5049 b: refs/heads/master c: 9f7ed2f h: refs/heads/master i: 5047: fe89400 v: v3
1 parent 96e6139 commit aea1f72

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4fc72c21302d907a17affeaa4b72e114474410b0
2+
refs/heads/master: 9f7ed2f054c72dd0989b42ed3e6a839e64d9fa1a

trunk/src/lib/vec.rs

+5
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ fn last<@T>(v: &[mutable? T]) -> option::t<T> {
9797
ret some(v[len(v) - 1u]);
9898
}
9999

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+
100105
/// Returns a copy of the elements from [`start`..`end`) from `v`.
101106
fn slice<@T>(v: &[mutable? T], start: uint, end: uint) -> [T] {
102107
assert (start <= end);

0 commit comments

Comments
 (0)