Skip to content

Commit 91f2d88

Browse files
committed
cargo test
1 parent 22cfbea commit 91f2d88

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ fn is_cloned_or_copied(cx: &LateContext<'_>, method_name: Symbol, method_def_id:
381381
/// Returns true if the named method can be used to convert the receiver to its "owned"
382382
/// representation.
383383
fn is_to_owned_like(cx: &LateContext<'_>, method_name: Symbol, method_def_id: DefId) -> bool {
384-
is_clone_like(cx, &*method_name.as_str(), method_def_id)
384+
is_clone_like(cx, method_name.as_str(), method_def_id)
385385
|| is_cow_into_owned(cx, method_name, method_def_id)
386386
|| is_to_string(cx, method_name, method_def_id)
387387
}

clippy_lints/src/size_of_in_element_count.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn get_pointee_ty_and_count_expr(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -
107107
// Find calls to copy_{from,to}{,_nonoverlapping} and write_bytes methods
108108
if let ExprKind::MethodCall(method_path, _, [ptr_self, .., count], _) = expr.kind;
109109
let method_ident = method_path.ident.as_str();
110-
if METHODS.iter().any(|m| *m == &*method_ident);
110+
if METHODS.iter().any(|m| *m == method_ident);
111111

112112
// Get the pointee type
113113
if let ty::RawPtr(TypeAndMut { ty: pointee_ty, .. }) =

clippy_lints/src/utils/internal_lints.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ fn check_invalid_clippy_version_attribute(cx: &LateContext<'_>, item: &'_ Item<'
490490
return;
491491
}
492492

493-
if RustcVersion::parse(&*value.as_str()).is_err() {
493+
if RustcVersion::parse(value.as_str()).is_err() {
494494
span_lint_and_help(
495495
cx,
496496
INVALID_CLIPPY_VERSION_ATTRIBUTE,
@@ -581,7 +581,7 @@ impl<'tcx> LateLintPass<'tcx> for CompilerLintFunctions {
581581
if_chain! {
582582
if let ExprKind::MethodCall(path, _, [self_arg, ..], _) = &expr.kind;
583583
let fn_name = path.ident;
584-
if let Some(sugg) = self.map.get(&*fn_name.as_str());
584+
if let Some(sugg) = self.map.get(fn_name.as_str());
585585
let ty = cx.typeck_results().expr_ty(self_arg).peel_refs();
586586
if match_type(cx, ty, &paths::EARLY_CONTEXT)
587587
|| match_type(cx, ty, &paths::LATE_CONTEXT);
@@ -665,7 +665,7 @@ impl<'tcx> LateLintPass<'tcx> for CollapsibleCalls {
665665
then {
666666
let and_then_snippets = get_and_then_snippets(cx, and_then_args);
667667
let mut sle = SpanlessEq::new(cx).deny_side_effects();
668-
match &*ps.ident.as_str() {
668+
match ps.ident.as_str() {
669669
"span_suggestion" if sle.eq_expr(&and_then_args[2], &span_call_args[1]) => {
670670
suggest_suggestion(cx, expr, &and_then_snippets, &span_suggestion_snippets(cx, span_call_args));
671671
},

clippy_lints/src/utils/internal_lints/metadata_collector.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,11 @@ fn extract_attr_docs_or_lint(cx: &LateContext<'_>, item: &Item<'_>) -> Option<St
526526
fn extract_attr_docs(cx: &LateContext<'_>, item: &Item<'_>) -> Option<String> {
527527
let attrs = cx.tcx.hir().attrs(item.hir_id());
528528
let mut lines = attrs.iter().filter_map(ast::Attribute::doc_str);
529-
let mut docs = String::from(&*lines.next()?.as_str());
529+
let mut docs = String::from(lines.next()?.as_str());
530530
let mut in_code_block = false;
531531
let mut is_code_block_rust = false;
532532
for line in lines {
533533
let line = line.as_str();
534-
let line = &*line;
535534

536535
// Rustdoc hides code lines starting with `# ` and this removes them from Clippy's lint list :)
537536
if is_code_block_rust && line.trim_start().starts_with("# ") {

0 commit comments

Comments
 (0)