about summary refs log tree commit diff
path: root/src/libstd/map.rs
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-10-11 14:12:50 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-11 14:17:59 -0700
commit5a8ba073bcd6ee6fd34ff545845a746cddc4904f (patch)
treeac61c449c7178937914d59a8c6c84bed74a52bd8 /src/libstd/map.rs
parent41bce91cb871ba90caf7d3e56243141dd3390bca (diff)
downloadrust-5a8ba073bcd6ee6fd34ff545845a746cddc4904f.tar.gz
rust-5a8ba073bcd6ee6fd34ff545845a746cddc4904f.zip
Make to_str pure and fix const parameters for str-mutating functions
Two separate changes that got intertwined (sorry):

Make to_str pure. Closes #3691

In str, change functions like push_char to take an &mut str instead of
an &str. Closes #3710
Diffstat (limited to 'src/libstd/map.rs')
-rw-r--r--src/libstd/map.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/map.rs b/src/libstd/map.rs
index 765d40339d3..9f78f98fa31 100644
--- a/src/libstd/map.rs
+++ b/src/libstd/map.rs
@@ -341,7 +341,8 @@ pub mod chained {
             wr.write_str(~" }");
         }
 
-        fn to_str() -> ~str {
+        pure fn to_str() -> ~str unsafe {
+            // Meh -- this should be safe
             do io::with_str_writer |wr| { self.to_writer(wr) }
         }
     }