1
Fork 0

add some purity annotations in core

This commit is contained in:
Niko Matsakis 2012-05-25 08:14:49 -07:00
parent c5d168c404
commit c5f2c1d61e
3 changed files with 72 additions and 75 deletions

View file

@ -1619,7 +1619,7 @@ fn reserve_at_least(&s: str, n: uint) unsafe {
Returns the number of single-byte characters the string can hold without
reallocating
"]
fn capacity(&&s: str) -> uint unsafe {
pure fn capacity(&&s: str) -> uint unsafe {
as_bytes(s) {|buf|
let vcap = vec::capacity(buf);
assert vcap > 0u;