Skip to content

Commit eae4137

Browse files
committed
fixing "base" gh action
1 parent 6493019 commit eae4137

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clippy_lints/src/arc_new_in_vec_from_slice.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ declare_clippy_lint! {
2727
#[clippy::version = "1.62.0"]
2828
pub ARC_NEW_IN_VEC_FROM_SLICE,
2929
suspicious,
30-
"default lint description"
30+
"calling `Arc::new` in `vec![elem; len]`"
3131
}
3232
declare_lint_pass!(ArcNewInVecFromSlice => [ARC_NEW_IN_VEC_FROM_SLICE]);
3333

@@ -69,11 +69,12 @@ fn first_arg_is_arc_new(args: &[Expr<'_>]) -> bool {
6969
if let ExprKind::Path(ref func_path) = func.kind;
7070
if let ExprKind::Path(QPath::TypeRelative(ty, _)) = func.kind;
7171
if let TyKind::Path(ref ty_path) = ty.kind;
72-
let func_segment = last_path_segment(func_path);
73-
let ty_segment = last_path_segment(ty_path);
7472

7573
then {
76-
return ty_segment.ident.name.as_str() == "Arc" && func_segment.ident.name.as_str() == "new";
74+
let func_segment = last_path_segment(func_path);
75+
let ty_segment = last_path_segment(ty_path);
76+
77+
return ty_segment.ident.name == sym::Arc && func_segment.ident.name == sym::new;
7778
}
7879
}
7980

0 commit comments

Comments
 (0)