Skip to content

Commit fa61869

Browse files
committed
---
yaml --- r: 63161 b: refs/heads/snap-stage3 c: 7281fb9 h: refs/heads/master i: 63159: ff1b4e2 v: v3
1 parent e78ef82 commit fa61869

File tree

4 files changed

+4
-65
lines changed

4 files changed

+4
-65
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: 0cfc08d81e7cc664330ce9d38a874c14a4ae51bf
4+
refs/heads/snap-stage3: 7281fb948a48f56e06f9a324d52e70e056071005
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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
use core::prelude::*;
3939

40+
use core::iterator::IteratorUtil;
4041
use core::str;
4142
use core::uint;
4243
use core::vec;
@@ -1079,9 +1080,7 @@ pub mod node {
10791080

10801081
pub fn loop_chars(node: @Node, it: &fn(c: char) -> bool) -> bool {
10811082
return loop_leaves(node,|leaf| {
1082-
str::all_between(*leaf.content,
1083-
leaf.byte_offset,
1084-
leaf.byte_len, it)
1083+
leaf.content.slice(leaf.byte_offset, leaf.byte_len).iter().all(it)
10851084
});
10861085
}
10871086

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

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,66 +1623,6 @@ pub fn char_at_reverse(s: &str, i: uint) -> char {
16231623
char_range_at_reverse(s, i).ch
16241624
}
16251625

1626-
/**
1627-
* Loop through a substring, char by char
1628-
*
1629-
* # Safety note
1630-
*
1631-
* * This function does not check whether the substring is valid.
1632-
* * This function fails if `start` or `end` do not
1633-
* represent valid positions inside `s`
1634-
*
1635-
* # Arguments
1636-
*
1637-
* * s - A string to traverse. It may be empty.
1638-
* * start - The byte offset at which to start in the string.
1639-
* * end - The end of the range to traverse
1640-
* * it - A block to execute with each consecutive character of `s`.
1641-
* Return `true` to continue, `false` to stop.
1642-
*
1643-
* # Return value
1644-
*
1645-
* `true` If execution proceeded correctly, `false` if it was interrupted,
1646-
* that is if `it` returned `false` at any point.
1647-
*/
1648-
pub fn all_between(s: &str, start: uint, end: uint,
1649-
it: &fn(char) -> bool) -> bool {
1650-
assert!(is_char_boundary(s, start));
1651-
let mut i = start;
1652-
while i < end {
1653-
let CharRange {ch, next} = char_range_at(s, i);
1654-
if !it(ch) { return false; }
1655-
i = next;
1656-
}
1657-
return true;
1658-
}
1659-
1660-
/**
1661-
* Loop through a substring, char by char
1662-
*
1663-
* # Safety note
1664-
*
1665-
* * This function does not check whether the substring is valid.
1666-
* * This function fails if `start` or `end` do not
1667-
* represent valid positions inside `s`
1668-
*
1669-
* # Arguments
1670-
*
1671-
* * s - A string to traverse. It may be empty.
1672-
* * start - The byte offset at which to start in the string.
1673-
* * end - The end of the range to traverse
1674-
* * it - A block to execute with each consecutive character of `s`.
1675-
* Return `true` to continue, `false` to stop.
1676-
*
1677-
* # Return value
1678-
*
1679-
* `true` if `it` returns `true` for any character
1680-
*/
1681-
pub fn any_between(s: &str, start: uint, end: uint,
1682-
it: &fn(char) -> bool) -> bool {
1683-
!all_between(s, start, end, |c| !it(c))
1684-
}
1685-
16861626
// UTF-8 tags and ranges
16871627
static tag_cont_u8: u8 = 128u8;
16881628
static tag_cont: uint = 128u;

branches/snap-stage3/src/libsyntax/parse/lexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ fn consume_any_line_comment(rdr: @mut StringReader)
307307

308308
pub fn is_block_non_doc_comment(s: &str) -> bool {
309309
assert!(s.len() >= 1u);
310-
str::all_between(s, 1u, s.len() - 1u, |ch| ch == '*')
310+
s.slice(1u, s.len() - 1u).iter().all(|ch| ch == '*')
311311
}
312312

313313
// might return a sugared-doc-attr

0 commit comments

Comments
 (0)