Skip to content

Commit ffee069

Browse files
killerswanmarijnh
authored andcommitted
---
yaml --- r: 11443 b: refs/heads/master c: c3318f2 h: refs/heads/master i: 11441: d19765c 11439: 206a0f8 v: v3
1 parent 9ea2db7 commit ffee069

File tree

4 files changed

+6
-27
lines changed

4 files changed

+6
-27
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: 7782f5d6926be7970ec474b74302f2298ceccd13
2+
refs/heads/master: c3318f29fecca14100e5956a013ab50395b7ceda
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/comp/syntax/codemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn lookup_byte_offset(cm: codemap::codemap, chpos: uint)
171171
let {fm,line} = lookup_line(cm,chpos,lookup);
172172
let line_offset = fm.lines[line].byte - fm.start_pos.byte;
173173
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);
175175
ret {fm: fm, pos: line_offset + col_offset};
176176
}
177177

trunk/src/libcore/str.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export
9393
// Misc
9494
// FIXME: perhaps some more of this section shouldn't be exported?
9595
is_utf8,
96-
substr_len_bytes,
96+
substr_len,
9797
substr_len_chars,
9898
utf8_char_width,
9999
char_range_at,
@@ -914,27 +914,6 @@ fn index_chars(ss: str, cc: char) -> option<uint> {
914914
ret none;
915915
}
916916

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, 0u, 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-
938917
// Function: rindex
939918
//
940919
// Returns the byte index of the first matching char

trunk/src/libstd/rope.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ mod node {
795795
if i == 0u { first_leaf_char_len }
796796
else { hint_max_leaf_char_len };
797797
let chunk_byte_len =
798-
str::substr_len_bytes(*str, offset, chunk_char_len);
798+
str::substr_len(*str, offset, chunk_char_len);
799799
nodes[i] = @leaf({
800800
byte_offset: offset,
801801
byte_len: chunk_byte_len,
@@ -1059,9 +1059,9 @@ mod node {
10591059
ret node;
10601060
}
10611061
let byte_offset =
1062-
str::substr_len_bytes(*x.content, 0u, char_offset);
1062+
str::substr_len(*x.content, 0u, char_offset);
10631063
let byte_len =
1064-
str::substr_len_bytes(*x.content, byte_offset, char_len);
1064+
str::substr_len(*x.content, byte_offset, char_len);
10651065
ret @leaf({byte_offset: byte_offset,
10661066
byte_len: byte_len,
10671067
char_len: char_len,

0 commit comments

Comments
 (0)