Skip to content

Commit e9ea46c

Browse files
jesse99brson
authored andcommitted
---
yaml --- r: 37643 b: refs/heads/try c: 0fd9c9d h: refs/heads/master i: 37641: a2775d3 37639: 1c20591 v: v3
1 parent bc8b511 commit e9ea46c

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 361aea94f2e037139e29a573ce4486c670bacb87
5+
refs/heads/try: 0fd9c9d0547c0f882465596f7cee77286cb8e56b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/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/try/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/try/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)