Skip to content

Commit 727862e

Browse files
committed
---
yaml --- r: 63172 b: refs/heads/snap-stage3 c: 248b6e3 h: refs/heads/master v: v3
1 parent bf4f186 commit 727862e

File tree

4 files changed

+10
-20
lines changed

4 files changed

+10
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ebefe425b962d3914cc523d7f539fdb2244cec06
4+
refs/heads/snap-stage3: 248b6e38b533d43b8b4adaf6d47efc62fe82ef2a
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libextra/rope.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ pub fn of_str(str: @~str) -> Rope {
8383
*
8484
* # Return value
8585
*
86-
* A rope representing the same string as `str::substr(str, byte_offset,
87-
* byte_len)`. Depending on `byte_len`, this rope may be empty, flat or
88-
* complex.
86+
* A rope representing the same string as `str.substr(byte_offset,
87+
* byte_len)`. Depending on `byte_len`, this rope may be empty, flat
88+
* or complex.
8989
*
9090
* # Performance note
9191
*

branches/snap-stage3/src/librustc/middle/resolve.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,11 +2684,11 @@ impl Resolver {
26842684
match self.idents_to_str(module_path).rfind(':') {
26852685
Some(idx) => {
26862686
self.session.span_err(span, fmt!("unresolved import: could not find `%s` \
2687-
in `%s`", str::substr(mpath, idx,
2688-
mpath.len() - idx),
2687+
in `%s`", mpath.substr(idx,
2688+
mpath.len() - idx),
26892689
// idx - 1 to account for the extra
26902690
// colon
2691-
str::substr(mpath, 0, idx - 1)));
2691+
mpath.substr(0, idx - 1)));
26922692
},
26932693
None => (),
26942694
};

branches/snap-stage3/src/libstd/str.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -432,16 +432,6 @@ pub fn byte_slice_no_callback<'a>(s: &'a str) -> &'a [u8] {
432432
}
433433
}
434434

435-
/**
436-
* Take a substring of another.
437-
*
438-
* Returns a slice pointing at `n` characters starting from byte offset
439-
* `begin`.
440-
*/
441-
pub fn substr<'a>(s: &'a str, begin: uint, n: uint) -> &'a str {
442-
s.slice(begin, begin + count_bytes(s, begin, n))
443-
}
444-
445435
/// Something that can be used to compare against a character
446436
pub trait CharEq {
447437
/// Determine if the splitter should split at the given character
@@ -1854,7 +1844,7 @@ impl<'self> StrSlice<'self> for &'self str {
18541844
*/
18551845
#[inline]
18561846
fn substr(&self, begin: uint, n: uint) -> &'self str {
1857-
substr(*self, begin, n)
1847+
s.slice(begin, begin + count_bytes(s, begin, n))
18581848
}
18591849
/// Escape each char in `s` with char::escape_default.
18601850
#[inline]
@@ -2516,11 +2506,11 @@ mod tests {
25162506
#[test]
25172507
fn test_substr() {
25182508
fn t(a: &str, b: &str, start: int) {
2519-
assert_eq!(substr(a, start as uint, b.len()), b);
2509+
assert_eq!(a.substr(start as uint, b.len()), b);
25202510
}
25212511
t("hello", "llo", 2);
25222512
t("hello", "el", 1);
2523-
assert_eq!("ะเทศไท", substr("ประเทศไทย中华Việt Nam", 6u, 6u));
2513+
assert_eq!("ะเทศไท", "ประเทศไทย中华Việt Nam".substr(6u, 6u));
25242514
}
25252515
25262516
#[test]

0 commit comments

Comments
 (0)