about summary refs log tree commit diff
path: root/src/libworkcache
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-14 21:16:44 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-16 11:41:27 -0700
commit28bcef85e402a32cf44b740f128e5f9bbd21c0a0 (patch)
tree15b222467760e8473355abe128dc7d8cdccca2b7 /src/libworkcache
parent67e39a8e7686bd33b9a8fbfc926f619029a33ac0 (diff)
downloadrust-28bcef85e402a32cf44b740f128e5f9bbd21c0a0.tar.gz
rust-28bcef85e402a32cf44b740f128e5f9bbd21c0a0.zip
libserialize: Remove all uses of `~str` from `libserialize`.
Had to make `struct Tm` in `libtime` not serializable for now.
Diffstat (limited to 'src/libworkcache')
-rw-r--r--src/libworkcache/lib.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libworkcache/lib.rs b/src/libworkcache/lib.rs
index 98fbb00f437..ec68a46b22c 100644
--- a/src/libworkcache/lib.rs
+++ b/src/libworkcache/lib.rs
@@ -192,7 +192,7 @@ impl Database {
         // FIXME(pcwalton): Yuck.
         let mut new_db_cache = TreeMap::new();
         for (ref k, ref v) in self.db_cache.iter() {
-            new_db_cache.insert((*k).to_owned(), (*v).to_owned());
+            new_db_cache.insert((*k).to_strbuf(), (*v).to_strbuf());
         }
 
         new_db_cache.to_json().to_pretty_writer(&mut f)
@@ -515,10 +515,13 @@ fn test() {
         let pth = pth.clone();
 
         let contents = File::open(&pth).read_to_end().unwrap();
-        let file_content = from_utf8(contents.as_slice()).unwrap().to_owned();
+        let file_content = from_utf8(contents.as_slice()).unwrap()
+                                                         .to_strbuf();
 
         // FIXME (#9639): This needs to handle non-utf8 paths
-        prep.declare_input("file", pth.as_str().unwrap(), file_content);
+        prep.declare_input("file",
+                           pth.as_str().unwrap(),
+                           file_content.as_slice());
         prep.exec(proc(_exe) {
             let out = make_path("foo.o".to_strbuf());
             let compiler = if cfg!(windows) {"gcc"} else {"cc"};
@@ -528,7 +531,7 @@ fn test() {
             // Could run sub-rules inside here.
 
             // FIXME (#9639): This needs to handle non-utf8 paths
-            out.as_str().unwrap().to_owned()
+            out.as_str().unwrap().to_strbuf()
         })
     });