about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorKevin Cantu <me@kevincantu.org>2012-02-01 03:41:58 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-01 21:56:53 -0800
commit6156bc56cbd1f40e538b59ff91ce9b8d89969ff3 (patch)
treeec399916523a701e8ac25903855e90d2210a9254 /src/libstd
parent47c57a17dc51ff32594b5759c300b84e380b9f7b (diff)
downloadrust-6156bc56cbd1f40e538b59ff91ce9b8d89969ff3.tar.gz
rust-6156bc56cbd1f40e538b59ff91ce9b8d89969ff3.zip
Propagating unsafe::slice 2
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/fs.rs4
-rw-r--r--src/libstd/getopts.rs8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index cbfca163c18..26a9931a0cb 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -63,7 +63,7 @@ path separators in the path then the returned path is identical to
 the provided path. If an empty path is provided or the path ends
 with a path separator then an empty path is returned.
 */
-fn basename(p: path) -> path {
+fn basename(p: path) -> path unsafe {
     let i: int = str::rindex(p, os_fs::path_sep as u8);
     if i == -1 {
         i = str::rindex(p, os_fs::alt_path_sep as u8);
@@ -71,7 +71,7 @@ fn basename(p: path) -> path {
     }
     let len = str::byte_len(p);
     if i + 1 as uint >= len { ret p; }
-    ret str::slice(p, i + 1 as uint, len);
+    ret str::unsafe::slice(p, i + 1 as uint, len);
 }
 
 
diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs
index 585ea48725f..5510dd3231a 100644
--- a/src/libstd/getopts.rs
+++ b/src/libstd/getopts.rs
@@ -209,7 +209,7 @@ ok(match) - On success. Use functions such as <opt_present>
             <opt_str>, etc. to interrogate results.
 err(fail_) - On failure. Use <fail_str> to get an error message.
 */
-fn getopts(args: [str], opts: [opt]) -> result {
+fn getopts(args: [str], opts: [opt]) -> result unsafe {
     let n_opts = vec::len::<opt>(opts);
     fn f(_x: uint) -> [optval] { ret []; }
     let vals = vec::init_fn_mut::<[optval]>(n_opts, f);
@@ -229,14 +229,14 @@ fn getopts(args: [str], opts: [opt]) -> result {
             let names;
             let i_arg = option::none::<str>;
             if cur[1] == '-' as u8 {
-                let tail = str::slice(cur, 2u, curlen);
+                let tail = str::unsafe::slice(cur, 2u, curlen);
                 let eq = str::index(tail, '=' as u8);
                 if eq == -1 {
                     names = [long(tail)];
                 } else {
-                    names = [long(str::slice(tail, 0u, eq as uint))];
+                    names = [long(str::unsafe::slice(tail, 0u, eq as uint))];
                     i_arg =
-                        option::some::<str>(str::slice(tail,
+                        option::some::<str>(str::unsafe::slice(tail,
                                                        (eq as uint) + 1u,
                                                        curlen - 2u));
                 }