about summary refs log tree commit diff
path: root/src/libhexfloat
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-18 18:46:33 -0700
committerbors <bors@rust-lang.org>2014-04-18 18:46:33 -0700
commitaf24045ff0e17764524a9eaf243479a3260c2d8b (patch)
treebc160d119b2d963afa53e9bbb59aacee6bdc4ecd /src/libhexfloat
parent9b7cfd3c724bbad9dd8a0115bb2619f307b73f8c (diff)
parent919889a1d688a6bbe2edac8705f048f06b1b455c (diff)
downloadrust-af24045ff0e17764524a9eaf243479a3260c2d8b.tar.gz
rust-af24045ff0e17764524a9eaf243479a3260c2d8b.zip
auto merge of #13607 : brson/rust/to_owned, r=brson
Continues https://github.com/mozilla/rust/pull/13548
Diffstat (limited to 'src/libhexfloat')
-rw-r--r--src/libhexfloat/lib.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libhexfloat/lib.rs b/src/libhexfloat/lib.rs
index e65b84091e5..4897924c55b 100644
--- a/src/libhexfloat/lib.rs
+++ b/src/libhexfloat/lib.rs
@@ -74,26 +74,26 @@ fn hex_float_lit_err(s: &str) -> Option<(uint, ~str)> {
     let mut chars = s.chars().peekable();
     let mut i = 0;
     if chars.peek() == Some(&'-') { chars.next(); i+= 1 }
-    if chars.next() != Some('0') { return Some((i, ~"Expected '0'")); } i+=1;
-    if chars.next() != Some('x') { return Some((i, ~"Expected 'x'")); } i+=1;
+    if chars.next() != Some('0') { return Some((i, "Expected '0'".to_owned())); } i+=1;
+    if chars.next() != Some('x') { return Some((i, "Expected 'x'".to_owned())); } i+=1;
     let mut d_len = 0;
     for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; d_len += 1;}
-    if chars.next() != Some('.') { return Some((i, ~"Expected '.'")); } i+=1;
+    if chars.next() != Some('.') { return Some((i, "Expected '.'".to_owned())); } i+=1;
     let mut f_len = 0;
     for _ in chars.take_while(|c| c.is_digit_radix(16)) { chars.next(); i+=1; f_len += 1;}
     if d_len == 0 && f_len == 0 {
-        return Some((i, ~"Expected digits before or after decimal point"));
+        return Some((i, "Expected digits before or after decimal point".to_owned()));
     }
-    if chars.next() != Some('p') { return Some((i, ~"Expected 'p'")); } i+=1;
+    if chars.next() != Some('p') { return Some((i, "Expected 'p'".to_owned())); } i+=1;
     if chars.peek() == Some(&'-') { chars.next(); i+= 1 }
     let mut e_len = 0;
     for _ in chars.take_while(|c| c.is_digit()) { chars.next(); i+=1; e_len += 1}
     if e_len == 0 {
-        return Some((i, ~"Expected exponent digits"));
+        return Some((i, "Expected exponent digits".to_owned()));
     }
     match chars.next() {
         None => None,
-        Some(_) => Some((i, ~"Expected end of string"))
+        Some(_) => Some((i, "Expected end of string".to_owned()))
     }
 }