Skip to content

Commit 63505d0

Browse files
jesse99brson
authored andcommitted
---
yaml --- r: 40457 b: refs/heads/dist-snap c: 0fd9c9d h: refs/heads/master i: 40455: ce5b635 v: v3
1 parent 25514e8 commit 63505d0

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 361aea94f2e037139e29a573ce4486c670bacb87
10+
refs/heads/dist-snap: 0fd9c9d0547c0f882465596f7cee77286cb8e56b
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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/dist-snap/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)