Skip to content

Commit d7f1daf

Browse files
committed
---
yaml --- r: 11252 b: refs/heads/master c: 0e61fe2 h: refs/heads/master v: v3
1 parent 98e240c commit d7f1daf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8309d50ff4ead4dd58b8f3c8388d5668e2e0d152
2+
refs/heads/master: 0e61fe2eeaff507ed409c432988aed40a9fe9c63
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/libcore/str.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,12 +932,12 @@ Parameters:
932932
haystack - The string to look in
933933
needle - The string to look for
934934
*/
935-
fn starts_with(haystack: str, needle: str) -> bool {
936-
let haystack_len: uint = len(haystack);
937-
let needle_len: uint = len(needle);
935+
fn starts_with(haystack: str, needle: str) -> bool unsafe {
936+
let haystack_len: uint = len_bytes(haystack);
937+
let needle_len: uint = len_bytes(needle);
938938
if needle_len == 0u { ret true; }
939939
if needle_len > haystack_len { ret false; }
940-
ret eq(substr(haystack, 0u, needle_len), needle);
940+
ret eq(unsafe::slice_bytes(haystack, 0u, needle_len), needle);
941941
}
942942

943943
/*

0 commit comments

Comments
 (0)