Skip to content

Commit ca415d2

Browse files
committed
---
yaml --- r: 4899 b: refs/heads/master c: 45b614f h: refs/heads/master i: 4897: 24f7bc7 4895: 86c9fe5 v: v3
1 parent 3e0628b commit ca415d2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 663d07d31973700758a269b30e6428057414ccbc
2+
refs/heads/master: 45b614f54ae7fa9f598917b9b220c2f10b0b37b8

trunk/src/lib/istr.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ concat, connect, to_upper, replace, char_slice, trim_left, trim_right, trim,
44
unshift_char, shift_char, pop_char, push_char, is_utf8, from_chars, to_chars,
55
char_len, char_at, bytes, is_ascii, shift_byte, pop_byte;
66

7+
export from_str, to_str;
8+
9+
fn from_str(s: &str) -> istr {
10+
let s2 = ~"";
11+
for u in s {
12+
push_byte(s2, u);
13+
}
14+
ret s2;
15+
}
16+
17+
fn to_str(s: &istr) -> str {
18+
let s2 = "";
19+
for u in s {
20+
str::push_byte(s2, u);
21+
}
22+
ret s2;
23+
}
24+
725
fn eq(a: &istr, b: &istr) -> bool { a == b }
826

927
fn lteq(a: &istr, b: &istr) -> bool { a <= b }

0 commit comments

Comments
 (0)