Skip to content

Commit 5163253

Browse files
committed
1 parent 3e1760c commit 5163253

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

clippy_lints/src/methods/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustc::{declare_lint_pass, declare_tool_lint};
1717
use rustc_errors::Applicability;
1818
use syntax::ast;
1919
use syntax::source_map::Span;
20-
use syntax::symbol::{sym, LocalInternedString, Symbol};
20+
use syntax::symbol::{sym, Symbol, SymbolStr};
2121

2222
use crate::utils::usage::mutated_variables;
2323
use crate::utils::{
@@ -1148,8 +1148,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
11481148
}
11491149

11501150
let (method_names, arg_lists, method_spans) = method_calls(expr, 2);
1151-
let method_names: Vec<LocalInternedString> = method_names.iter().map(|s| s.as_str()).collect();
1152-
let method_names: Vec<&str> = method_names.iter().map(std::convert::AsRef::as_ref).collect();
1151+
let method_names: Vec<SymbolStr> = method_names.iter().map(|s| s.as_str()).collect();
1152+
let method_names: Vec<&str> = method_names.iter().map(|s| &**s).collect();
11531153

11541154
match method_names.as_slice() {
11551155
["unwrap", "get"] => lint_get_unwrap(cx, expr, arg_lists[1], false),

clippy_lints/src/non_expressive_names.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::cmp::Ordering;
55
use syntax::ast::*;
66
use syntax::attr;
77
use syntax::source_map::Span;
8-
use syntax::symbol::LocalInternedString;
8+
use syntax::symbol::SymbolStr;
99
use syntax::visit::{walk_block, walk_expr, walk_pat, Visitor};
1010

1111
declare_clippy_lint! {
@@ -72,7 +72,7 @@ pub struct NonExpressiveNames {
7272
impl_lint_pass!(NonExpressiveNames => [SIMILAR_NAMES, MANY_SINGLE_CHAR_NAMES, JUST_UNDERSCORES_AND_DIGITS]);
7373

7474
struct ExistingName {
75-
interned: LocalInternedString,
75+
interned: SymbolStr,
7676
span: Span,
7777
len: usize,
7878
whitelist: &'static [&'static str],

clippy_lints/src/path_buf_push_overwrite.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PathBufPushOverwrite {
5050
if let Some(get_index_arg) = args.get(1);
5151
if let ExprKind::Lit(ref lit) = get_index_arg.kind;
5252
if let LitKind::Str(ref path_lit, _) = lit.node;
53-
if let pushed_path = Path::new(&path_lit.as_str());
53+
if let pushed_path = Path::new(&*path_lit.as_str());
5454
if let Some(pushed_path_lit) = pushed_path.to_str();
5555
if pushed_path.has_root();
5656
if let Some(root) = pushed_path.components().next();

clippy_lints/src/unsafe_removed_from_name.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
33
use rustc::{declare_lint_pass, declare_tool_lint};
44
use syntax::ast::*;
55
use syntax::source_map::Span;
6-
use syntax::symbol::LocalInternedString;
6+
use syntax::symbol::SymbolStr;
77

88
declare_clippy_lint! {
99
/// **What it does:** Checks for imports that remove "unsafe" from an item's
@@ -73,6 +73,6 @@ fn unsafe_to_safe_check(old_name: Ident, new_name: Ident, cx: &EarlyContext<'_>,
7373
}
7474

7575
#[must_use]
76-
fn contains_unsafe(name: &LocalInternedString) -> bool {
76+
fn contains_unsafe(name: &SymbolStr) -> bool {
7777
name.contains("Unsafe") || name.contains("unsafe")
7878
}

clippy_lints/src/utils/internal_lints.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1313
use rustc_errors::Applicability;
1414
use syntax::ast::{Crate as AstCrate, ItemKind, Name};
1515
use syntax::source_map::Span;
16-
use syntax_pos::symbol::LocalInternedString;
16+
use syntax_pos::symbol::SymbolStr;
1717

1818
declare_clippy_lint! {
1919
/// **What it does:** Checks for various things we like to keep tidy in clippy.
@@ -112,7 +112,7 @@ impl EarlyLintPass for ClippyLintsInternal {
112112
if let ItemKind::Mod(ref utils_mod) = utils.kind {
113113
if let Some(paths) = utils_mod.items.iter().find(|item| item.ident.name.as_str() == "paths") {
114114
if let ItemKind::Mod(ref paths_mod) = paths.kind {
115-
let mut last_name: Option<LocalInternedString> = None;
115+
let mut last_name: Option<SymbolStr> = None;
116116
for item in &*paths_mod.items {
117117
let name = item.ident.as_str();
118118
if let Some(ref last_name) = last_name {
@@ -279,8 +279,8 @@ declare_lint_pass!(OuterExpnDataPass => [OUTER_EXPN_EXPN_DATA]);
279279
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnDataPass {
280280
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
281281
let (method_names, arg_lists, spans) = method_calls(expr, 2);
282-
let method_names: Vec<LocalInternedString> = method_names.iter().map(|s| s.as_str()).collect();
283-
let method_names: Vec<&str> = method_names.iter().map(std::convert::AsRef::as_ref).collect();
282+
let method_names: Vec<SymbolStr> = method_names.iter().map(|s| s.as_str()).collect();
283+
let method_names: Vec<&str> = method_names.iter().map(|s| &**s).collect();
284284
if_chain! {
285285
if let ["expn_data", "outer_expn"] = method_names.as_slice();
286286
let args = arg_lists[1];

0 commit comments

Comments
 (0)