Replace all uses of &foo[] with &foo[..] en masse.
This commit is contained in:
parent
64cd30e0ca
commit
9ea84aeed4
145 changed files with 865 additions and 864 deletions
|
|
@ -37,9 +37,9 @@ impl LintPass for Pass {
|
|||
|
||||
fn check_item(&mut self, cx: &Context, it: &ast::Item) {
|
||||
let name = token::get_ident(it.ident);
|
||||
if &name[] == "lintme" {
|
||||
if &name[..] == "lintme" {
|
||||
cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'");
|
||||
} else if &name[] == "pleaselintme" {
|
||||
} else if &name[..] == "pleaselintme" {
|
||||
cx.span_lint(PLEASE_LINT, it.span, "item is named 'pleaselintme'");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ impl LintPass for Pass {
|
|||
|
||||
fn check_item(&mut self, cx: &Context, it: &ast::Item) {
|
||||
let name = token::get_ident(it.ident);
|
||||
if &name[] == "lintme" {
|
||||
if &name[..] == "lintme" {
|
||||
cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ impl TTMacroExpander for Expander {
|
|||
_: &[ast::TokenTree]) -> Box<MacResult+'cx> {
|
||||
let args = self.args.iter().map(|i| pprust::meta_item_to_string(&*i))
|
||||
.collect::<Vec<_>>().connect(", ");
|
||||
let interned = token::intern_and_get_ident(&args[]);
|
||||
let interned = token::intern_and_get_ident(&args[..]);
|
||||
MacExpr::new(ecx.expr_str(sp, interned))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use std::cell::RefCell;
|
|||
#[cfg(cannot_use_this_yet)]
|
||||
fn foo<'a>(map: RefCell<HashMap<&'static str, &'a [u8]>>) {
|
||||
let one = [1u];
|
||||
assert_eq!(map.borrow().get("one"), Some(&one[]));
|
||||
assert_eq!(map.borrow().get("one"), Some(&one[..]));
|
||||
}
|
||||
|
||||
#[cfg(cannot_use_this_yet_either)]
|
||||
|
|
@ -45,9 +45,9 @@ fn main() {
|
|||
let one = [1u8];
|
||||
let two = [2u8];
|
||||
let mut map = HashMap::new();
|
||||
map.insert("zero", &zer[]);
|
||||
map.insert("one", &one[]);
|
||||
map.insert("two", &two[]);
|
||||
map.insert("zero", &zer[..]);
|
||||
map.insert("one", &one[..]);
|
||||
map.insert("two", &two[..]);
|
||||
let map = RefCell::new(map);
|
||||
foo(map);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue