Skip to content

Commit 9d9a209

Browse files
committed
back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> slice_unique
1 parent 8f44488 commit 9d9a209

32 files changed

+124
-124
lines changed

doc/rust.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ An example of `use` declarations:
806806

807807
~~~~
808808
use core::float::sin;
809-
use core::str::{slice_DBG_BRWD, to_upper};
809+
use core::str::{slice, to_upper};
810810
use core::option::Some;
811811
812812
fn main() {
@@ -817,8 +817,8 @@ fn main() {
817817
info!(Some(1.0));
818818
819819
// Equivalent to
820-
// 'info!(core::str::to_upper(core::str::slice_DBG_BRWD("foo", 0, 1)));'
821-
info!(to_upper(slice_DBG_BRWD("foo", 0, 1)));
820+
// 'info!(core::str::to_upper(core::str::slice("foo", 0, 1)));'
821+
info!(to_upper(slice("foo", 0, 1)));
822822
}
823823
~~~~
824824

@@ -2668,7 +2668,7 @@ Within the body of an item that has type parameter declarations, the names of it
26682668
fn map<A: Copy, B: Copy>(f: &fn(A) -> B, xs: &[A]) -> ~[B] {
26692669
if xs.len() == 0 { return ~[]; }
26702670
let first: B = f(xs[0]);
2671-
let rest: ~[B] = map(f, xs.slice_V_DBG_BRWD(1, xs.len()));
2671+
let rest: ~[B] = map(f, xs.slice(1, xs.len()));
26722672
return ~[first] + rest;
26732673
}
26742674
~~~~~~~

src/compiletest/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
5151
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
5252
let start_kind = idx;
5353
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
54-
let kind = str::to_lower(str::slice_DBG_BRWD(line, start_kind, idx).to_owned());
54+
let kind = str::to_lower(str::slice(line, start_kind, idx).to_owned());
5555

5656
// Extract msg:
5757
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
58-
let msg = str::slice_DBG_BRWD(line, idx, len).to_owned();
58+
let msg = str::slice(line, idx, len).to_owned();
5959

6060
debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
6161

src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn parse_name_value_directive(line: ~str,
174174
let keycolon = directive + ~":";
175175
match str::find_str(line, keycolon) {
176176
Some(colon) => {
177-
let value = str::slice_DBG_BRWD(line, colon + str::len(keycolon),
177+
let value = str::slice(line, colon + str::len(keycolon),
178178
str::len(line)).to_owned();
179179
debug!("%s: %s", directive, value);
180180
Some(value)

src/libcore/num/strconv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,14 @@ pub pure fn to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+
364364

365365
// only resize buf if we actually remove digits
366366
if i < buf_max_i {
367-
buf = buf.slice_V_DBG_BRWD(0, i + 1).to_owned();
367+
buf = buf.slice(0, i + 1).to_owned();
368368
}
369369
}
370370
} // If exact and trailing '.', just cut that
371371
else {
372372
let max_i = buf.len() - 1;
373373
if buf[max_i] == '.' as u8 {
374-
buf = buf.slice_V_DBG_BRWD(0, max_i).to_owned();
374+
buf = buf.slice(0, max_i).to_owned();
375375
}
376376
}
377377

@@ -606,7 +606,7 @@ pub pure fn from_str_bytes_common<T:NumCast+Zero+One+Ord+Copy+Div<T,T>+
606606
// parse remaining bytes as decimal integer,
607607
// skipping the exponent char
608608
let exp: Option<int> = from_str_bytes_common(
609-
buf.slice_V_DBG_BRWD(i+1, len), 10, true, false, false, ExpNone, false);
609+
buf.slice(i+1, len), 10, true, false, false, ExpNone, false);
610610

611611
match exp {
612612
Some(exp_pow) => {

src/libcore/path.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ impl GenericPath for PosixPath {
410410
None => None,
411411
Some(ref f) => {
412412
match str::rfind_char(*f, '.') {
413-
Some(p) => Some(f.slice_DBG_BRWD(0, p).to_owned()),
413+
Some(p) => Some(f.slice(0, p).to_owned()),
414414
None => Some(copy *f)
415415
}
416416
}
@@ -422,7 +422,7 @@ impl GenericPath for PosixPath {
422422
None => None,
423423
Some(ref f) => {
424424
match str::rfind_char(*f, '.') {
425-
Some(p) if p < f.len() => Some(f.slice_DBG_BRWD(p, f.len()).to_owned()),
425+
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
426426
_ => None
427427
}
428428
}
@@ -622,7 +622,7 @@ impl GenericPath for WindowsPath {
622622
None => None,
623623
Some(ref f) => {
624624
match str::rfind_char(*f, '.') {
625-
Some(p) => Some(f.slice_DBG_BRWD(0, p).to_owned()),
625+
Some(p) => Some(f.slice(0, p).to_owned()),
626626
None => Some(copy *f)
627627
}
628628
}
@@ -634,7 +634,7 @@ impl GenericPath for WindowsPath {
634634
None => None,
635635
Some(ref f) => {
636636
match str::rfind_char(*f, '.') {
637-
Some(p) if p < f.len() => Some(f.slice_DBG_BRWD(p, f.len()).to_owned()),
637+
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
638638
_ => None
639639
}
640640
}
@@ -842,8 +842,8 @@ pub mod windows {
842842
let mut i = 2;
843843
while i < s.len() {
844844
if is_sep(s[i]) {
845-
let pre = s.slice_DBG_BRWD(2, i).to_owned();
846-
let mut rest = s.slice_DBG_BRWD(i, s.len()).to_owned();
845+
let pre = s.slice(2, i).to_owned();
846+
let mut rest = s.slice(i, s.len()).to_owned();
847847
return Some((pre, rest));
848848
}
849849
i += 1;
@@ -860,9 +860,9 @@ pub mod windows {
860860
let rest = if s.len() == 2 {
861861
~""
862862
} else {
863-
s.slice_DBG_BRWD(2, s.len()).to_owned()
863+
s.slice(2, s.len()).to_owned()
864864
};
865-
return Some((s.slice_DBG_BRWD(0,1).to_owned(), rest));
865+
return Some((s.slice(0,1).to_owned(), rest));
866866
}
867867
None
868868
}

src/libcore/rt/uv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ fn listen() {
878878
if status.is_none() {
879879
rtdebug!("got %d bytes", nread);
880880
let buf = buf.unwrap();
881-
for buf.slice_V_DBG_BRWD(0, nread as uint).each |byte| {
881+
for buf.slice(0, nread as uint).each |byte| {
882882
fail_unless!(*byte == count as u8);
883883
rtdebug!("%u", *byte as uint);
884884
count += 1;

src/libcore/run.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ fn read_all(rd: io::Reader) -> ~str {
303303
let mut bytes = [0, ..4096];
304304
while !rd.eof() {
305305
let nread = rd.read(bytes, bytes.len());
306-
wr.write(bytes.slice_V_DBG_BRWD(0, nread));
306+
wr.write(bytes.slice(0, nread));
307307
}
308308
});
309309
str::from_bytes(buf)
@@ -404,7 +404,7 @@ pub fn readclose(fd: c_int) -> ~str {
404404
let mut bytes = [0, ..4096];
405405
while !reader.eof() {
406406
let nread = reader.read(bytes, bytes.len());
407-
writer.write(bytes.slice_V_DBG_BRWD(0, nread));
407+
writer.write(bytes.slice(0, nread));
408408
}
409409
});
410410
os::fclose(file);

0 commit comments

Comments
 (0)