diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-16 16:46:24 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-16 16:46:32 -0700 |
| commit | 3445454e792bc4b770a99e227fc18b5c90f8ed8a (patch) | |
| tree | 53dd059a7e525704199de120fa6efdf2877342a1 /src/libcore | |
| parent | 9e9f4a6240b79ff64c5169296468950045e83515 (diff) | |
| download | rust-3445454e792bc4b770a99e227fc18b5c90f8ed8a.tar.gz rust-3445454e792bc4b770a99e227fc18b5c90f8ed8a.zip | |
core: Resolve and remove some FIXMEs
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/str.rs | 2 | ||||
| -rw-r--r-- | src/libcore/vec.rs | 9 |
2 files changed, 1 insertions, 10 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 224b52aa695..c8e32bb4138 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -106,8 +106,6 @@ native mod rustrt { fn str_reserve_shared(&ss: str, nn: libc::size_t); } -// FIXME: add pure to a lot of functions - /* Section: Creating a string */ diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index c7955413975..d69507b75c1 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -94,9 +94,7 @@ type init_op<T> = fn(uint) -> T; #[doc = "Returns true if a vector contains no elements"] pure fn is_empty<T>(v: [const T]) -> bool { - // FIXME: This would be easier if we could just call len - for t: T in v { ret false; } - ret true; + len(v) == 0u } #[doc = "Returns true if a vector contains some elements"] @@ -154,8 +152,6 @@ fn from_elem<T: copy>(n_elts: uint, t: T) -> [T] { ret v; } -// FIXME: Possible typestate postcondition: -// len(result) == len(v) (needs issue #586) #[doc = "Produces a mutable vector from an immutable vector."] fn to_mut<T>(+v: [T]) -> [mutable T] unsafe { let r = ::unsafe::reinterpret_cast(v); @@ -185,9 +181,6 @@ fn tailn<T: copy>(v: [const T], n: uint) -> [T] { slice(v, n, len(v)) } -// FIXME: This name is sort of confusing next to from_fn, etc -// but this is the name haskell uses for this function, -// along with head/tail/last. #[doc = "Returns all but the last elemnt of a vector"] fn init<T: copy>(v: [const T]) -> [T] { assert len(v) != 0u; |
