diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2012-02-17 13:17:40 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-02-17 23:03:12 +0100 |
| commit | ff429645461c83dca048d8a7088c04ee15cc96c8 (patch) | |
| tree | b0e7f4ff8ff8becd67aa3f90fcdbf7b5cb029a18 /src/libcore | |
| parent | 1c1261bcb86841cc5fdedd9db0f0ced8a178cb4d (diff) | |
| download | rust-ff429645461c83dca048d8a7088c04ee15cc96c8.tar.gz rust-ff429645461c83dca048d8a7088c04ee15cc96c8.zip | |
Clean up some of trans using block combinators
`with_scope` and `with_cond` can be used to wrap a piece of code in a scope block, or conditionalize it on a value, without doing all the context-creation and jumping by hand. Also renames @block_ctxt to block to reduce noise.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/vec.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 1f0abca0255..77853405362 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -186,11 +186,8 @@ pure fn head<T: copy>(v: [const T]) : is_not_empty(v) -> T { ret v[0]; } Function: tail Returns all but the first element of a vector - -Predicates: -<is_not_empty> (v) */ -fn tail<T: copy>(v: [const T]) : is_not_empty(v) -> [T] { +fn tail<T: copy>(v: [const T]) -> [T] { ret slice(v, 1u, len(v)); } |
