Skip to content

Commit 14c18e7

Browse files
committed
---
yaml --- r: 46407 b: refs/heads/auto c: ae86c03 h: refs/heads/master i: 46405: fe4e99d 46403: 31f1b30 46399: ddcb6a7 v: v3
1 parent 487e91f commit 14c18e7

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 3c0eca7940f51e267528bba537cdeb8ce9f7e506
17+
refs/heads/auto: ae86c03af261fd116d53f98766fb3700435b0bc1

branches/auto/src/librustc/middle/lint.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -834,26 +834,23 @@ fn check_item_non_camel_case_types(cx: ty::ctxt, it: @ast::item) {
834834
fn is_camel_case(cx: ty::ctxt, ident: ast::ident) -> bool {
835835
let ident = cx.sess.str_of(ident);
836836
assert !ident.is_empty();
837-
let ident = ident_without_trailing_underscores(ident);
837+
let ident = ident_without_trailing_underscores(*ident);
838838
let ident = ident_without_leading_underscores(ident);
839839
char::is_uppercase(str::char_at(ident, 0)) &&
840840
!ident.contains_char('_')
841841
}
842842

843-
fn ident_without_trailing_underscores(+ident: ~str) -> ~str {
843+
fn ident_without_trailing_underscores(ident: &r/str) -> &r/str {
844844
match str::rfind(ident, |c| c != '_') {
845-
Some(idx) => (ident).slice(0, idx + 1),
846-
None => { ident } // all underscores
845+
Some(idx) => str::view(ident, 0, idx + 1),
846+
None => ident, // all underscores
847847
}
848848
}
849849

850-
fn ident_without_leading_underscores(+ident: ~str) -> ~str {
850+
fn ident_without_leading_underscores(ident: &r/str) -> &r/str {
851851
match str::find(ident, |c| c != '_') {
852-
Some(idx) => ident.slice(idx, ident.len()),
853-
None => {
854-
// all underscores
855-
ident
856-
}
852+
Some(idx) => str::view(ident, idx, ident.len()),
853+
None => ident // all underscores
857854
}
858855
}
859856

0 commit comments

Comments
 (0)