File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 8309d50ff4ead4dd58b8f3c8388d5668e2e0d152
5
+ refs/heads/try: 0e61fe2eeaff507ed409c432988aed40a9fe9c63
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -932,12 +932,12 @@ Parameters:
932
932
haystack - The string to look in
933
933
needle - The string to look for
934
934
*/
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) ;
938
938
if needle_len == 0 u { ret true ; }
939
939
if needle_len > haystack_len { ret false ; }
940
- ret eq( substr ( haystack, 0 u, needle_len) , needle) ;
940
+ ret eq( unsafe :: slice_bytes ( haystack, 0 u, needle_len) , needle) ;
941
941
}
942
942
943
943
/*
You can’t perform that action at this time.
0 commit comments