Skip to content

Commit e43e4c7

Browse files
committed
Partially revert 2c1f2ff
1 parent bb79ca4 commit e43e4c7

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ fn check_other_call_arg<'tcx>(
253253
} else if trait_predicate.def_id() == as_ref_trait_id {
254254
let composed_substs = compose_substs(
255255
cx,
256-
&*trait_predicate.trait_ref.substs.iter().skip(1).collect::<Vec<_>>(),
256+
&trait_predicate.trait_ref.substs.iter().skip(1).collect::<Vec<_>>()[..],
257257
call_substs
258258
);
259259
implements_trait(cx, receiver_ty, as_ref_trait_id, &composed_substs)

clippy_lints/src/needless_arbitrary_self_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum Mode {
6767

6868
fn check_param_inner(cx: &EarlyContext<'_>, path: &Path, span: Span, binding_mode: &Mode, mutbl: Mutability) {
6969
if_chain! {
70-
if let [segment] = &*path.segments;
70+
if let [segment] = &path.segments[..];
7171
if segment.ident.name == kw::SelfUpper;
7272
then {
7373
// In case we have a named lifetime, we check if the name comes from expansion.

clippy_lints/src/utils/internal_lints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ fn extract_clippy_version_value(cx: &LateContext<'_>, item: &'_ Item<'_>) -> Opt
525525
if_chain! {
526526
// Identify attribute
527527
if let ast::AttrKind::Normal(ref attr_kind, _) = &attr.kind;
528-
if let [tool_name, attr_name] = &*attr_kind.path.segments;
528+
if let [tool_name, attr_name] = &attr_kind.path.segments[..];
529529
if tool_name.ident.name == sym::clippy;
530530
if attr_name.ident.name == sym::version;
531531
if let Some(version) = attr.value_str();
@@ -976,7 +976,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidPaths {
976976
unreachable!()
977977
}
978978
}).collect();
979-
if !check_path(cx, &*path);
979+
if !check_path(cx, &path[..]);
980980
then {
981981
span_lint(cx, INVALID_PATHS, item.span, "invalid path");
982982
}

tests/ui/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66

77
let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
88

9-
let _ = (&*x).iter().filter(|&a| *a == 0).count(); // naive byte count
9+
let _ = (&x[..]).iter().filter(|&a| *a == 0).count(); // naive byte count
1010

1111
let _ = x.iter().filter(|a| **a > 0).count(); // not an equality count, OK.
1212

tests/ui/bytecount.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | #[deny(clippy::naive_bytecount)]
1313
error: you appear to be counting bytes the naive way
1414
--> $DIR/bytecount.rs:9:13
1515
|
16-
LL | let _ = (&*x).iter().filter(|&a| *a == 0).count(); // naive byte count
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the bytecount crate: `bytecount::count((&*x), 0)`
16+
LL | let _ = (&x[..]).iter().filter(|&a| *a == 0).count(); // naive byte count
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using the bytecount crate: `bytecount::count((&x[..]), 0)`
1818

1919
error: you appear to be counting bytes the naive way
2020
--> $DIR/bytecount.rs:21:13

tests/ui/indexing_slicing_slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// We also check the out_of_bounds_indexing lint here, because it lints similar things and
33
// we want to avoid false positives.
44
#![warn(clippy::out_of_bounds_indexing)]
5-
#![allow(clippy::no_effect, clippy::unnecessary_operation, clippy::redundant_slicing)]
5+
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
66

77
fn main() {
88
let x = [1, 2, 3, 4];

tests/ui/str_to_string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
fn main() {
44
let hello = "hello world".to_string();
5-
let msg = &*hello;
5+
let msg = &hello[..];
66
msg.to_string();
77
}

0 commit comments

Comments
 (0)