Skip to content

Commit 7ed1333

Browse files
committed
Use CountIsStart in clippy
1 parent 9a67767 commit 7ed1333

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/tools/clippy/clippy_lints/src/write.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ impl SimpleFormatArgs {
526526
str_lit_span: Span,
527527
fmt_span: Span,
528528
) {
529-
use rustc_parse_format::{ArgumentImplicitlyIs, ArgumentIs, CountIsParam};
529+
use rustc_parse_format::{ArgumentImplicitlyIs, ArgumentIs, CountIsParam, CountIsStar};
530530

531531
let snippet = snippet_opt(cx, fmt_span);
532532

@@ -540,7 +540,7 @@ impl SimpleFormatArgs {
540540
self.push_to_complex(span, n);
541541
};
542542

543-
if let (CountIsParam(n), Some(span)) = (arg.format.precision, arg.format.precision_span) {
543+
if let (CountIsParam(n) | CountIsStar(n), Some(span)) = (arg.format.precision, arg.format.precision_span) {
544544
// We need to do this hack as precision spans should be converted from .* to .foo$
545545
let hack = if snippet.as_ref().and_then(|s| s.find('*')).is_some() {
546546
0

src/tools/clippy/clippy_utils/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ impl<'tcx> Count<'tcx> {
644644
span,
645645
values,
646646
)?),
647-
rpf::Count::CountIsParam(_) => {
647+
rpf::Count::CountIsParam(_) | rpf::Count::CountIsStar(_) => {
648648
Self::Param(FormatParam::new(FormatParamKind::Numbered, position?, inner?, values)?)
649649
},
650650
rpf::Count::CountImplied => Self::Implied,

0 commit comments

Comments
 (0)