diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2013-03-20 19:13:13 +0100 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2013-03-21 01:50:32 +0100 |
| commit | a7d296f24c785e359bfd6d9e491fd8854c3ad967 (patch) | |
| tree | dd86187e73441b9bc2bad0157a49f791baac6e06 /src/libstd | |
| parent | b12714eff5dd2ccde118c520444990216739e006 (diff) | |
| download | rust-a7d296f24c785e359bfd6d9e491fd8854c3ad967.tar.gz rust-a7d296f24c785e359bfd6d9e491fd8854c3ad967.zip | |
renamed str::view -> slice_DBG_BRWD
renamed str::slice -> slice_DBG_UNIQ changed vec slice method -> to_owned() renamed vec view method -> slice_V_DBG_BRWD
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/bitv.rs | 6 | ||||
| -rw-r--r-- | src/libstd/flatpipes.rs | 2 | ||||
| -rw-r--r-- | src/libstd/getopts.rs | 4 | ||||
| -rw-r--r-- | src/libstd/net_url.rs | 44 | ||||
| -rw-r--r-- | src/libstd/rope.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sha1.rs | 4 |
6 files changed, 32 insertions, 32 deletions
diff --git a/src/libstd/bitv.rs b/src/libstd/bitv.rs index 430a5eab64e..cbf605e7258 100644 --- a/src/libstd/bitv.rs +++ b/src/libstd/bitv.rs @@ -831,7 +831,7 @@ priv impl BitvSet { f: &fn(uint, uint, uint) -> bool) { let min = uint::min(self.bitv.storage.len(), other.bitv.storage.len()); - for self.bitv.storage.view(0, min).eachi |i, &w| { + for self.bitv.storage.slice_V_DBG_BRWD(0, min).eachi |i, &w| { if !f(i * uint::bits, w, other.bitv.storage[i]) { return; } @@ -852,12 +852,12 @@ priv impl BitvSet { let min = uint::min(len1, len2); /* only one of these loops will execute and that's the point */ - for self.bitv.storage.view(min, len1).eachi |i, &w| { + for self.bitv.storage.slice_V_DBG_BRWD(min, len1).eachi |i, &w| { if !f(true, (i + min) * uint::bits, w) { return; } } - for other.bitv.storage.view(min, len2).eachi |i, &w| { + for other.bitv.storage.slice_V_DBG_BRWD(min, len2).eachi |i, &w| { if !f(false, (i + min) * uint::bits, w) { return; } diff --git a/src/libstd/flatpipes.rs b/src/libstd/flatpipes.rs index c5515c63b29..176d3c73b62 100644 --- a/src/libstd/flatpipes.rs +++ b/src/libstd/flatpipes.rs @@ -571,7 +571,7 @@ pub mod bytepipes { fn try_recv(&self, count: uint) -> Option<~[u8]> { if vec::uniq_len(&const self.buf) >= count { let mut bytes = ::core::util::replace(&mut self.buf, ~[]); - self.buf = bytes.slice(count, bytes.len()); + self.buf = bytes.slice_V_DBG_BRWD(count, bytes.len()).to_owned(); bytes.truncate(count); return Some(bytes); } else if vec::uniq_len(&const self.buf) > 0 { diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 0b615e0c0da..f19def7ad86 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -243,7 +243,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result { let mut names; let mut i_arg = None; if cur[1] == '-' as u8 { - let tail = str::slice(cur, 2, curlen); + let tail = str::slice_DBG_BRWD(cur, 2, curlen).to_owned(); let tail_eq = str::splitn_char(tail, '=', 1); if tail_eq.len() <= 1 { names = ~[Long(tail)]; @@ -279,7 +279,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result { No => false }; if arg_follows && j < curlen { - i_arg = Some(cur.slice(j, curlen)); + i_arg = Some(cur.slice_DBG_BRWD(j, curlen).to_owned()); break; } else { last_valid_opt_id = None; diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index 0bb8fdd3738..c5d0446f156 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -317,10 +317,10 @@ pure fn split_char_first(s: &str, c: char) -> (~str, ~str) { } } if index+mat == len { - return (str::slice(s, 0, index), ~""); + return (str::slice_DBG_BRWD(s, 0, index).to_owned(), ~""); } else { - return (str::slice(s, 0, index), - str::slice(s, index + mat, str::len(s))); + return (str::slice_DBG_BRWD(s, 0, index).to_owned(), + str::slice_DBG_BRWD(s, index + mat, str::len(s)).to_owned()); } } @@ -386,8 +386,8 @@ pub pure fn get_scheme(rawurl: &str) -> Result<(~str, ~str), ~str> { if i == 0 { return Err(~"url: Scheme cannot be empty."); } else { - return Ok((rawurl.slice(0,i), - rawurl.slice(i+1,str::len(rawurl)))); + return Ok((rawurl.slice_DBG_BRWD(0,i).to_owned(), + rawurl.slice_DBG_BRWD(i+1,str::len(rawurl)).to_owned())); } } _ => { @@ -489,7 +489,7 @@ pure fn get_authority(rawurl: &str) -> } Ip6Host => { if colon_count > 7 { - host = str::slice(rawurl, begin, i); + host = str::slice_DBG_BRWD(rawurl, begin, i).to_owned(); pos = i; st = InPort; } @@ -506,13 +506,13 @@ pure fn get_authority(rawurl: &str) -> colon_count = 0; // reset count match st { Start => { - let user = str::slice(rawurl, begin, i); + let user = str::slice_DBG_BRWD(rawurl, begin, i).to_owned(); userinfo = Some(UserInfo::new(user, None)); st = InHost; } PassHostPort => { - let user = str::slice(rawurl, begin, pos); - let pass = str::slice(rawurl, pos+1, i); + let user = str::slice_DBG_BRWD(rawurl, begin, pos).to_owned(); + let pass = str::slice_DBG_BRWD(rawurl, pos+1, i).to_owned(); userinfo = Some(UserInfo::new(user, Some(pass))); st = InHost; } @@ -543,31 +543,31 @@ pure fn get_authority(rawurl: &str) -> match st { Start => { if host_is_end_plus_one() { - host = str::slice(rawurl, begin, end+1); + host = str::slice_DBG_BRWD(rawurl, begin, end+1).to_owned(); } else { - host = str::slice(rawurl, begin, end); + host = str::slice_DBG_BRWD(rawurl, begin, end).to_owned(); } } PassHostPort | Ip6Port => { if in != Digit { return Err(~"Non-digit characters in port."); } - host = str::slice(rawurl, begin, pos); - port = Some(str::slice(rawurl, pos+1, end)); + host = str::slice_DBG_BRWD(rawurl, begin, pos).to_owned(); + port = Some(str::slice_DBG_BRWD(rawurl, pos+1, end).to_owned()); } Ip6Host | InHost => { - host = str::slice(rawurl, begin, end); + host = str::slice_DBG_BRWD(rawurl, begin, end).to_owned(); } InPort => { if in != Digit { return Err(~"Non-digit characters in port."); } - port = Some(str::slice(rawurl, pos+1, end)); + port = Some(str::slice_DBG_BRWD(rawurl, pos+1, end).to_owned()); } } let rest = if host_is_end_plus_one() { ~"" } - else { str::slice(rawurl, end, len) }; + else { str::slice_DBG_BRWD(rawurl, end, len).to_owned() }; return Ok((userinfo, host, port, rest)); } @@ -599,8 +599,8 @@ pure fn get_path(rawurl: &str, authority: bool) -> } } - return Ok((decode_component(str::slice(rawurl, 0, end)), - str::slice(rawurl, end, len))); + return Ok((decode_component(str::slice_DBG_BRWD(rawurl, 0, end).to_owned()), + str::slice_DBG_BRWD(rawurl, end, len).to_owned())); } // returns the parsed query and the fragment, if present @@ -608,16 +608,16 @@ pure fn get_query_fragment(rawurl: &str) -> Result<(Query, Option<~str>), ~str> { if !str::starts_with(rawurl, ~"?") { if str::starts_with(rawurl, ~"#") { - let f = decode_component(str::slice(rawurl, + let f = decode_component(str::slice_DBG_BRWD(rawurl, 1, - str::len(rawurl))); + str::len(rawurl)).to_owned()); return Ok((~[], Some(f))); } else { return Ok((~[], None)); } } - let (q, r) = split_char_first(str::slice(rawurl, 1, - str::len(rawurl)), '#'); + let (q, r) = split_char_first(str::slice_DBG_BRWD(rawurl, 1, + str::len(rawurl)).to_owned(), '#'); let f = if str::len(r) != 0 { Some(decode_component(r)) } else { None }; return Ok((query_from_str(q), f)); diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index dd2f5b58fb9..f796a7fa98e 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -1293,9 +1293,9 @@ mod tests { unsafe { match (*node) { node::Leaf(x) => { - *str += str::slice( + *str += str::slice_DBG_BRWD( *x.content, x.byte_offset, - x.byte_offset + x.byte_len); + x.byte_offset + x.byte_len).to_owned(); } node::Concat(ref x) => { aux(str, x.left); diff --git a/src/libstd/sha1.rs b/src/libstd/sha1.rs index f7e31bc7df7..e4723ff0a2b 100644 --- a/src/libstd/sha1.rs +++ b/src/libstd/sha1.rs @@ -398,8 +398,8 @@ mod tests { let mut left = len; while left > 0u { let take = (left + 1u) / 2u; - sh.input_str(str::slice(t.input, len - left, - take + len - left)); + sh.input_str(str::slice_DBG_BRWD(t.input, len - left, + take + len - left).to_owned()); left = left - take; } let out = sh.result(); |
