Skip to content

Commit ae76da7

Browse files
committed
---
yaml --- r: 36346 b: refs/heads/try2 c: 401093e h: refs/heads/master v: v3
1 parent 5481733 commit ae76da7

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0c11a12bdbfb804c2aef0dc164fd8ecc1f5d3eeb
8+
refs/heads/try2: 401093ec7d66f898338abb30b8097e06bfeb1a58
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libcore/from_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
use option::Option;
88

99
pub trait FromStr {
10-
static fn from_str(s: &str) -> Option<self>;
10+
static pure fn from_str(s: &str) -> Option<self>;
1111
}
1212

branches/try2/src/libcore/int-template.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl T: iter::Times {
106106
* * buf - A byte buffer
107107
* * radix - The base of the number
108108
*/
109-
pub fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
109+
pub pure fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
110110
if vec::len(buf) == 0u { return None; }
111111
let mut i = vec::len(buf) - 1u;
112112
let mut start = 0u;
@@ -129,10 +129,13 @@ pub fn parse_bytes(buf: &[u8], radix: uint) -> Option<T> {
129129
}
130130

131131
/// Parse a string to an int
132-
pub fn from_str(s: &str) -> Option<T> { parse_bytes(str::to_bytes(s), 10u) }
132+
pub pure fn from_str(s: &str) -> Option<T>
133+
{
134+
parse_bytes(str::to_bytes(s), 10u)
135+
}
133136

134137
impl T : FromStr {
135-
static fn from_str(s: &str) -> Option<T> { from_str(s) }
138+
static pure fn from_str(s: &str) -> Option<T> { from_str(s) }
136139
}
137140

138141
/// Convert to a string in a given base

branches/try2/src/libcore/uint-template.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl T: iter::Times {
100100
*
101101
* `buf` must not be empty
102102
*/
103-
pub fn parse_bytes(buf: &[const u8], radix: uint) -> Option<T> {
103+
pub pure fn parse_bytes(buf: &[const u8], radix: uint) -> Option<T> {
104104
if vec::len(buf) == 0u { return None; }
105105
let mut i = vec::len(buf) - 1u;
106106
let mut power = 1u as T;
@@ -117,10 +117,13 @@ pub fn parse_bytes(buf: &[const u8], radix: uint) -> Option<T> {
117117
}
118118

119119
/// Parse a string to an int
120-
pub fn from_str(s: &str) -> Option<T> { parse_bytes(str::to_bytes(s), 10u) }
120+
pub pure fn from_str(s: &str) -> Option<T>
121+
{
122+
parse_bytes(str::to_bytes(s), 10u)
123+
}
121124

122125
impl T : FromStr {
123-
static fn from_str(s: &str) -> Option<T> { from_str(s) }
126+
static pure fn from_str(s: &str) -> Option<T> { from_str(s) }
124127
}
125128

126129
/// Parse a string as an unsigned integer.

0 commit comments

Comments
 (0)