Skip to content

Commit

Permalink
Ran rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
xd009642 committed Mar 9, 2019
1 parent 60e5966 commit 2620220
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 155 deletions.
2 changes: 1 addition & 1 deletion src/errors/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use failure::Fail;
use crate::report::cobertura;
use failure::Fail;
/// Error states that could be returned from tarpaulin
#[derive(Fail, Debug)]
pub enum RunError {
Expand Down
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::traces::*;
use cargo::core::{compiler::CompileMode, Package, Shell, Workspace};
use cargo::ops;
use cargo::util::{homedir, Config as CargoConfig};
use log::{debug, info, warn, trace};
use log::{debug, info, trace, warn};
use nix::unistd::*;
use std::env;
use std::ffi::CString;
Expand All @@ -29,7 +29,7 @@ mod ptrace_control;
pub fn run(config: &Config) -> Result<(), RunError> {
let (tracemap, ret) = launch_tarpaulin(config)?;
report_coverage(config, &tracemap)?;

if ret == 0 {
Ok(())
} else {
Expand Down Expand Up @@ -128,7 +128,6 @@ pub fn launch_tarpaulin(config: &Config) -> Result<(TraceMap, i32), RunError> {
}
}


fn setup_environment(config: &Config) {
let rustflags = "RUSTFLAGS";
let mut value =
Expand All @@ -143,7 +142,6 @@ fn setup_environment(config: &Config) {
env::set_var(rustflags, value);
}


fn accumulate_lines(
(mut acc, mut group): (Vec<String>, Vec<u64>),
next: u64,
Expand Down Expand Up @@ -224,8 +222,7 @@ pub fn report_coverage(config: &Config, result: &TraceMap) -> Result<(), RunErro
for g in &config.generate {
match *g {
OutputFile::Xml => {
report::cobertura::report(result, config)
.map_err(|e| RunError::XML(e))?;
report::cobertura::report(result, config).map_err(|e| RunError::XML(e))?;
}
OutputFile::Html => {
report::html::export(result, config)?;
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use cargo_tarpaulin::run;
use clap::{crate_version, App, Arg, ArgSettings, SubCommand};
use env_logger::Builder;
use log::error;
use log::trace;
use std::io::Write;
use std::path::Path;
use log::trace;

fn is_dir(d: String) -> Result<(), String> {
if Path::new(&d).is_dir() {
Expand Down
Loading

0 comments on commit 2620220

Please sign in to comment.