Skip to content

Commit

Permalink
apply clippy fixes and update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-kfed committed Sep 5, 2023
1 parent b335d22 commit bd4a754
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-F ambiguous-associated-items -F cenum-impl-drop-cast -F coherence-leak-check -F conflicting-repr-hints -F const-err -F const-evaluatable-unchecked -F deprecated-cfg-attr-crate-type-name -F deref-into-dyn-supertrait -A forbidden-lint-groups -F ill-formed-attribute-input -F illegal-floating-point-literal-pattern -F indirect-structural-match -F invalid-doc-attributes -F invalid-type-param-default -F late-bound-lifetime-arguments -F legacy-derive-helpers -F macro-expanded-macro-exports-accessed-by-absolute-paths -F missing-fragment-specifier -F nontrivial-structural-match -F order-dependent-trait-objects -F patterns-in-fns-without-body -F pointer-structural-match -F private-in-public -F proc-macro-back-compat -F proc-macro-derive-resolution-fallback -F pub-use-of-private-extern-crate -F semicolon-in-expressions-from-macros -F soft-unstable -F unaligned-references -F uninhabited-static -F unstable-name-collisions -F unsupported-calling-conventions -F where-clauses-object-safety -D warnings -D missing_docs -F rust-2021-compatibility -D rust-2018-idioms -D nonstandard-style"
RUSTFLAGS: "-F ambiguous-associated-items -F cenum-impl-drop-cast -F coherence-leak-check -F conflicting-repr-hints -F const-evaluatable-unchecked -F deprecated-cfg-attr-crate-type-name -F deref-into-dyn-supertrait -A forbidden-lint-groups -F ill-formed-attribute-input -F illegal-floating-point-literal-pattern -F indirect-structural-match -F invalid-doc-attributes -F invalid-type-param-default -F late-bound-lifetime-arguments -F legacy-derive-helpers -F macro-expanded-macro-exports-accessed-by-absolute-paths -F missing-fragment-specifier -F nontrivial-structural-match -F order-dependent-trait-objects -F patterns-in-fns-without-body -F pointer-structural-match -F private-in-public -F proc-macro-back-compat -F proc-macro-derive-resolution-fallback -F pub-use-of-private-extern-crate -F semicolon-in-expressions-from-macros -F soft-unstable -F uninhabited-static -F unstable-name-collisions -F unsupported-calling-conventions -F where-clauses-object-safety -D warnings -D missing_docs -F rust-2021-compatibility -D rust-2018-idioms -D nonstandard-style"
CLIPPY_FLAGS: "-D clippy::expect_used -D clippy::panic -D clippy::unwrap_used -D clippy::unimplemented -F clippy::suspicious -F clippy::style -F clippy::complexity -F clippy::perf"

jobs:
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ clap = { version = "4.0", features = ["derive"]}
lcov = "0.8.1"
lcov2cobertura = { path = "lcov2cobertura" }

[dev-dependencies]
quick-xml = "0.30.0"

[profile.release]
strip = "symbols"
4 changes: 2 additions & 2 deletions lcov2cobertura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Package {

impl CompSummary for Package {
fn summary(&self) -> Summary {
let lines_total = self.classes.values().map(|c| c.lines.len() as usize).sum();
let lines_total = self.classes.values().map(|c| c.lines.len()).sum();
let lines_covered = self.classes.values().map(|c| c.lines_covered).sum();
let branches_total = self
.classes
Expand Down Expand Up @@ -128,7 +128,7 @@ impl Class {

impl CompSummary for Class {
fn summary(&self) -> Summary {
let lines_total = self.lines.len() as usize;
let lines_total = self.lines.len();
let lines_covered = self.lines_covered;
let branches_total = self.lines.values().map(|b| b.branches_total).sum::<usize>();
let branches_covered = self
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cobertura_split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ struct Args {

fn main() -> anyhow::Result<()> {
let args = Args::parse();
lcov2xml::corbertura_xml_split(&args.filename)?;
lcov2xml::corbertura_xml_split(args.filename)?;
Ok(())
}

0 comments on commit bd4a754

Please sign in to comment.