Skip to content

Commit e78ef82

Browse files
committed
---
yaml --- r: 63160 b: refs/heads/snap-stage3 c: 0cfc08d h: refs/heads/master v: v3
1 parent ff1b4e2 commit e78ef82

File tree

10 files changed

+159
-406
lines changed

10 files changed

+159
-406
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: 76fc9be5a1634c8b7ebf766f51ad594d9012fe9c
4+
refs/heads/snap-stage3: 0cfc08d81e7cc664330ce9d38a874c14a4ae51bf
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ fn scan_until_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
417417
if *idx >= haystack.len() {
418418
return false;
419419
}
420-
let opt = str::find_char_from(haystack, needle, *idx);
420+
let opt = haystack.slice_from(*idx).find(needle);
421421
if opt.is_none() {
422422
return false;
423423
}

branches/snap-stage3/src/libfuzzer/fuzzer.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ pub fn check_variants_T<T:Copy>(crate: @ast::crate,
375375
}
376376

377377
pub fn last_part(filename: ~str) -> ~str {
378-
let ix = str::rfind_char(filename, '/').get();
378+
let ix = filename.rfind('/').get();
379379
filename.slice(ix + 1u, filename.len() - 3u).to_owned()
380380
}
381381

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -841,26 +841,11 @@ fn check_item_non_camel_case_types(cx: &Context, it: @ast::item) {
841841
fn is_camel_case(cx: ty::ctxt, ident: ast::ident) -> bool {
842842
let ident = cx.sess.str_of(ident);
843843
assert!(!ident.is_empty());
844-
let ident = ident_without_trailing_underscores(*ident);
845-
let ident = ident_without_leading_underscores(ident);
844+
let ident = ident.trim_chars(&['_']);
846845
char::is_uppercase(str::char_at(ident, 0)) &&
847846
!ident.contains_char('_')
848847
}
849848

850-
fn ident_without_trailing_underscores<'r>(ident: &'r str) -> &'r str {
851-
match str::rfind(ident, |c| c != '_') {
852-
Some(idx) => ident.slice(0, idx + 1),
853-
None => ident, // all underscores
854-
}
855-
}
856-
857-
fn ident_without_leading_underscores<'r>(ident: &'r str) -> &'r str {
858-
match str::find(ident, |c| c != '_') {
859-
Some(idx) => ident.slice(idx, ident.len()),
860-
None => ident // all underscores
861-
}
862-
}
863-
864849
fn check_case(cx: &Context, ident: ast::ident, span: span) {
865850
if !is_camel_case(cx.tcx, ident) {
866851
cx.span_lint(non_camel_case_types, span,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2681,7 +2681,7 @@ impl Resolver {
26812681
match module_prefix_result {
26822682
Failed => {
26832683
let mpath = self.idents_to_str(module_path);
2684-
match str::rfind(self.idents_to_str(module_path), |c| { c == ':' }) {
2684+
match self.idents_to_str(module_path).rfind(':') {
26852685
Some(idx) => {
26862686
self.session.span_err(span, fmt!("unresolved import: could not find `%s` \
26872687
in `%s`", str::substr(mpath, idx,

branches/snap-stage3/src/librustdoc/desc_to_brief_pass.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,17 @@ fn first_sentence_(s: &str) -> ~str {
118118
let mut dotcount = 0;
119119
// The index of the character following a single dot. This allows
120120
// Things like [0..1) to appear in the brief description
121-
let idx = do str::find(s) |ch| {
121+
let idx = s.find(|ch: char| {
122122
if ch == '.' {
123123
dotcount += 1;
124124
false
125+
} else if dotcount == 1 {
126+
true
125127
} else {
126-
if dotcount == 1 {
127-
true
128-
} else {
129-
dotcount = 0;
130-
false
131-
}
128+
dotcount = 0;
129+
false
132130
}
133-
};
131+
});
134132
match idx {
135133
Some(idx) if idx > 2u => {
136134
str::to_owned(s.slice(0, idx - 1))

branches/snap-stage3/src/librustpkg/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub fn split_version<'a>(s: &'a str) -> Option<(&'a str, Version)> {
175175
if { let mut i: uint = 0; for str::to_chars(s).each |&c| { if c == '#' { i += 1; } }; i > 1 } {
176176
return None;
177177
}
178-
match str::rfind_char(s, '#') {
178+
match s.rfind('#') {
179179
Some(i) => {
180180
debug!("in %s, i = %?", s, i);
181181
let path = s.slice(0, i);

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ impl GenericPath for PosixPath {
479479
match self.filename() {
480480
None => None,
481481
Some(ref f) => {
482-
match str::rfind_char(*f, '.') {
483-
Some(p) => Some(f.slice(0, p).to_owned()),
482+
match f.rfind('.') {
483+
Some(p) => Some(f.slice_to(p).to_owned()),
484484
None => Some(copy *f),
485485
}
486486
}
@@ -491,8 +491,8 @@ impl GenericPath for PosixPath {
491491
match self.filename() {
492492
None => None,
493493
Some(ref f) => {
494-
match str::rfind_char(*f, '.') {
495-
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
494+
match f.rfind('.') {
495+
Some(p) if p < f.len() => Some(f.slice_from(p).to_owned()),
496496
_ => None,
497497
}
498498
}
@@ -693,8 +693,8 @@ impl GenericPath for WindowsPath {
693693
match self.filename() {
694694
None => None,
695695
Some(ref f) => {
696-
match str::rfind_char(*f, '.') {
697-
Some(p) => Some(f.slice(0, p).to_owned()),
696+
match f.rfind('.') {
697+
Some(p) => Some(f.slice_to(p).to_owned()),
698698
None => Some(copy *f),
699699
}
700700
}
@@ -705,8 +705,8 @@ impl GenericPath for WindowsPath {
705705
match self.filename() {
706706
None => None,
707707
Some(ref f) => {
708-
match str::rfind_char(*f, '.') {
709-
Some(p) if p < f.len() => Some(f.slice(p, f.len()).to_owned()),
708+
match f.rfind('.') {
709+
Some(p) if p < f.len() => Some(f.slice_from(p).to_owned()),
710710
_ => None,
711711
}
712712
}

0 commit comments

Comments
 (0)