Runs `cargo fmt` against the [`Self::touched_crates()`]
(&self)
| 168 | |
| 169 | /// Runs `cargo fmt` against the [`Self::touched_crates()`] |
| 170 | pub fn rustfmt(&self) -> Result<()> { |
| 171 | let touched_crates = self.touched_crates(); |
| 172 | if touched_crates.is_empty() { |
| 173 | return Ok(()); |
| 174 | } |
| 175 | |
| 176 | cmd!(std::env::var("CARGO") |
| 177 | .as_ref() |
| 178 | .map(Deref::deref) |
| 179 | .unwrap_or("cargo")) |
| 180 | .arg("fmt") |
| 181 | .arg("--package") |
| 182 | .args(touched_crates) |
| 183 | .run()?; |
| 184 | |
| 185 | Ok(()) |
| 186 | } |
| 187 | |
| 188 | /// Pushes the changes introduced to staged files in the working tree |
| 189 | /// to the git index. It is important to call this function once you've |
no test coverage detected