Skip to content

Commit 3c8bda2

Browse files
committed
---
yaml --- r: 47816 b: refs/heads/incoming c: ae86c03 h: refs/heads/master v: v3
1 parent a54aa9c commit 3c8bda2

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
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 3c0eca7940f51e267528bba537cdeb8ce9f7e506
9+
refs/heads/incoming: ae86c03af261fd116d53f98766fb3700435b0bc1
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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)