File tree Expand file tree Collapse file tree 4 files changed +6
-27
lines changed Expand file tree Collapse file tree 4 files changed +6
-27
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 7782f5d6926be7970ec474b74302f2298ceccd13
2
+ refs/heads/master: c3318f29fecca14100e5956a013ab50395b7ceda
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ fn lookup_byte_offset(cm: codemap::codemap, chpos: uint)
171
171
let { fm, line} = lookup_line ( cm, chpos, lookup) ;
172
172
let line_offset = fm. lines [ line] . byte - fm. start_pos . byte ;
173
173
let col = chpos - fm. lines [ line] . ch ;
174
- let col_offset = str:: substr_len_bytes ( * fm. src , line_offset, col) ;
174
+ let col_offset = str:: substr_len ( * fm. src , line_offset, col) ;
175
175
ret { fm : fm, pos : line_offset + col_offset} ;
176
176
}
177
177
Original file line number Diff line number Diff line change 93
93
// Misc
94
94
// FIXME: perhaps some more of this section shouldn't be exported?
95
95
is_utf8,
96
- substr_len_bytes ,
96
+ substr_len ,
97
97
substr_len_chars,
98
98
utf8_char_width,
99
99
char_range_at,
@@ -914,27 +914,6 @@ fn index_chars(ss: str, cc: char) -> option<uint> {
914
914
ret none;
915
915
}
916
916
917
- // Function: byte_index
918
- //
919
- // Returns the index of the first matching byte
920
- // (as option some/none)
921
- // FIXME: delete
922
- fn byte_index ( s : str , b : u8 ) -> option < uint > {
923
- byte_index_from ( s, b, 0 u, len ( s) )
924
- }
925
-
926
- // Function: byte_index_from
927
- //
928
- // Returns the index of the first matching byte within the range [`start`,
929
- // `end`).
930
- // (as option some/none)
931
- // FIXME: delete
932
- fn byte_index_from ( s : str , b : u8 , start : uint , end : uint ) -> option < uint > {
933
- assert end <= len ( s) ;
934
-
935
- str:: as_bytes ( s) { |v| vec:: position_from ( v, start, end) { |x| x == b } }
936
- }
937
-
938
917
// Function: rindex
939
918
//
940
919
// Returns the byte index of the first matching char
Original file line number Diff line number Diff line change @@ -795,7 +795,7 @@ mod node {
795
795
if i == 0 u { first_leaf_char_len }
796
796
else { hint_max_leaf_char_len } ;
797
797
let chunk_byte_len =
798
- str:: substr_len_bytes ( * str, offset, chunk_char_len) ;
798
+ str:: substr_len ( * str, offset, chunk_char_len) ;
799
799
nodes[ i] = @leaf ( {
800
800
byte_offset: offset,
801
801
byte_len: chunk_byte_len,
@@ -1059,9 +1059,9 @@ mod node {
1059
1059
ret node;
1060
1060
}
1061
1061
let byte_offset =
1062
- str:: substr_len_bytes ( * x. content , 0 u, char_offset) ;
1062
+ str:: substr_len ( * x. content , 0 u, char_offset) ;
1063
1063
let byte_len =
1064
- str:: substr_len_bytes ( * x. content , byte_offset, char_len) ;
1064
+ str:: substr_len ( * x. content , byte_offset, char_len) ;
1065
1065
ret @leaf ( { byte_offset: byte_offset,
1066
1066
byte_len: byte_len,
1067
1067
char_len: char_len,
You can’t perform that action at this time.
0 commit comments