Improve code readability by moving fmt args directly into the string

This commit is contained in:
Guillaume Gomez
2023-08-14 22:25:32 +02:00
parent 3071e0aef6
commit a1a94b1c0f
35 changed files with 261 additions and 300 deletions

View File

@@ -146,8 +146,8 @@ impl<'a, 'b> CoverageCalculator<'a, 'b> {
examples_percentage: f64,
) {
println!(
"| {:<35} | {:>10} | {:>9.1}% | {:>10} | {:>9.1}% |",
name, count.with_docs, percentage, count.with_examples, examples_percentage,
"| {name:<35} | {:>10} | {percentage:>9.1}% | {:>10} | {:>9.1}% |",
count.with_docs, count.with_examples, examples_percentage,
);
}
@@ -249,7 +249,7 @@ impl<'a, 'b> DocVisitor for CoverageCalculator<'a, 'b> {
if let Some(span) = i.span(self.ctx.tcx) {
let filename = span.filename(self.ctx.sess());
debug!("counting {:?} {:?} in {:?}", i.type_(), i.name, filename);
debug!("counting {:?} {:?} in {filename:?}", i.type_(), i.name);
self.items.entry(filename).or_default().count_item(
has_docs,
has_doc_example,