diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-03-08 21:53:12 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-03-08 21:53:12 -0600 |
commit | f8ddc5645066a080fa87eabb5ce4a6f77ca7d4b3 (patch) | |
tree | 8b8275621e667e5c370e81b517a2e4909c98c8aa /rosalind | |
parent | 8026d2618d3b48bdcb1363ad4d651b37c41030a3 (diff) | |
download | rosalind-f8ddc5645066a080fa87eabb5ce4a6f77ca7d4b3.tar.gz rosalind-f8ddc5645066a080fa87eabb5ce4a6f77ca7d4b3.zip |
use str::with_capacity here too
Diffstat (limited to 'rosalind')
-rw-r--r-- | rosalind/str.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/rosalind/str.rs b/rosalind/str.rs index 7837055..c96024a 100644 --- a/rosalind/str.rs +++ b/rosalind/str.rs @@ -2,8 +2,7 @@ use str = core::str; /* really feels like there should be a more efficient way to do this */ fn reverse(s: &str) -> ~str { - let mut r = ~""; - str::reserve(&mut r, str::len(s)); + let mut r = str::with_capacity(str::len(s)); for str::each_char(s) |ch| { str::unshift_char(&mut r, ch) } |