Skip to content

Commit

Permalink
back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNI…
Browse files Browse the repository at this point in the history
…Q -> slice_unique
  • Loading branch information
Kimundi committed Mar 21, 2013
1 parent 8f44488 commit 9d9a209
Show file tree
Hide file tree
Showing 32 changed files with 124 additions and 124 deletions.
8 changes: 4 additions & 4 deletions doc/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ An example of `use` declarations:

~~~~
use core::float::sin;
use core::str::{slice_DBG_BRWD, to_upper};
use core::str::{slice, to_upper};
use core::option::Some;
fn main() {
Expand All @@ -817,8 +817,8 @@ fn main() {
info!(Some(1.0));
// Equivalent to
// 'info!(core::str::to_upper(core::str::slice_DBG_BRWD("foo", 0, 1)));'
info!(to_upper(slice_DBG_BRWD("foo", 0, 1)));
// 'info!(core::str::to_upper(core::str::slice("foo", 0, 1)));'
info!(to_upper(slice("foo", 0, 1)));
}
~~~~

Expand Down Expand Up @@ -2668,7 +2668,7 @@ Within the body of an item that has type parameter declarations, the names of it
fn map<A: Copy, B: Copy>(f: &fn(A) -> B, xs: &[A]) -> ~[B] {
if xs.len() == 0 { return ~[]; }
let first: B = f(xs[0]);
let rest: ~[B] = map(f, xs.slice_V_DBG_BRWD(1, xs.len()));
let rest: ~[B] = map(f, xs.slice(1, xs.len()));
return ~[first] + rest;
}
~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions src/compiletest/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
let start_kind = idx;
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
let kind = str::to_lower(str::slice_DBG_BRWD(line, start_kind, idx).to_owned());
let kind = str::to_lower(str::slice(line, start_kind, idx).to_owned());

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn parse_name_value_directive(line: ~str,
let keycolon = directive + ~":";
match str::find_str(line, keycolon) {
Some(colon) => {
let value = str::slice_DBG_BRWD(line, colon + str::len(keycolon),
let value = str::slice(line, colon + str::len(keycolon),
str::len(line)).to_owned();
debug!("%s: %s", directive, value);
Some(value)
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/num/strconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@ pub pure fn to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+

// only resize buf if we actually remove digits
if i < buf_max_i {
buf = buf.slice_V_DBG_BRWD(0, i + 1).to_owned();
buf = buf.slice(0, i + 1).to_owned();
}
}
} // If exact and trailing '.', just cut that
else {
let max_i = buf.len() - 1;
if buf[max_i] == '.' as u8 {
buf = buf.slice_V_DBG_BRWD(0, max_i).to_owned();
buf = buf.slice(0, max_i).to_owned();
}
}

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

match exp {
Some(exp_pow) => {
Expand Down
16 changes: 8 additions & 8 deletions src/libcore/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl GenericPath for PosixPath {
None => None,
Some(ref f) => {
match str::rfind_char(*f, '.') {
Some(p) => Some(f.slice_DBG_BRWD(0, p).to_owned()),
Some(p) => Some(f.slice(0, p).to_owned()),
None => Some(copy *f)
}
}
Expand All @@ -422,7 +422,7 @@ impl GenericPath for PosixPath {
None => None,
Some(ref f) => {
match str::rfind_char(*f, '.') {
Some(p) if p < f.len() => Some(f.slice_DBG_BRWD(p, f.len()).to_owned()),
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
_ => None
}
}
Expand Down Expand Up @@ -622,7 +622,7 @@ impl GenericPath for WindowsPath {
None => None,
Some(ref f) => {
match str::rfind_char(*f, '.') {
Some(p) => Some(f.slice_DBG_BRWD(0, p).to_owned()),
Some(p) => Some(f.slice(0, p).to_owned()),
None => Some(copy *f)
}
}
Expand All @@ -634,7 +634,7 @@ impl GenericPath for WindowsPath {
None => None,
Some(ref f) => {
match str::rfind_char(*f, '.') {
Some(p) if p < f.len() => Some(f.slice_DBG_BRWD(p, f.len()).to_owned()),
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
_ => None
}
}
Expand Down Expand Up @@ -842,8 +842,8 @@ pub mod windows {
let mut i = 2;
while i < s.len() {
if is_sep(s[i]) {
let pre = s.slice_DBG_BRWD(2, i).to_owned();
let mut rest = s.slice_DBG_BRWD(i, s.len()).to_owned();
let pre = s.slice(2, i).to_owned();
let mut rest = s.slice(i, s.len()).to_owned();
return Some((pre, rest));
}
i += 1;
Expand All @@ -860,9 +860,9 @@ pub mod windows {
let rest = if s.len() == 2 {
~""
} else {
s.slice_DBG_BRWD(2, s.len()).to_owned()
s.slice(2, s.len()).to_owned()
};
return Some((s.slice_DBG_BRWD(0,1).to_owned(), rest));
return Some((s.slice(0,1).to_owned(), rest));
}
None
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/rt/uv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ fn listen() {
if status.is_none() {
rtdebug!("got %d bytes", nread);
let buf = buf.unwrap();
for buf.slice_V_DBG_BRWD(0, nread as uint).each |byte| {
for buf.slice(0, nread as uint).each |byte| {
fail_unless!(*byte == count as u8);
rtdebug!("%u", *byte as uint);
count += 1;
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ fn read_all(rd: io::Reader) -> ~str {
let mut bytes = [0, ..4096];
while !rd.eof() {
let nread = rd.read(bytes, bytes.len());
wr.write(bytes.slice_V_DBG_BRWD(0, nread));
wr.write(bytes.slice(0, nread));
}
});
str::from_bytes(buf)
Expand Down Expand Up @@ -404,7 +404,7 @@ pub fn readclose(fd: c_int) -> ~str {
let mut bytes = [0, ..4096];
while !reader.eof() {
let nread = reader.read(bytes, bytes.len());
writer.write(bytes.slice_V_DBG_BRWD(0, nread));
writer.write(bytes.slice(0, nread));
}
});
os::fclose(file);
Expand Down
Loading

0 comments on commit 9d9a209

Please sign in to comment.