Skip to content

Commit

Permalink
Minor clippy fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Mar 4, 2024
1 parent 8aa6c72 commit b0e3e41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn main() {

let mut args: Vec<_> = std::env::args_os().collect();
args.remove(0); // file path
if args.get(0).and_then(|s| s.to_str()) == Some("bloat") {
if args.first().and_then(|s| s.to_str()) == Some("bloat") {
args.remove(0);
} else {
eprintln!("Error: can be run only via `cargo bloat`.");
Expand Down Expand Up @@ -508,7 +508,7 @@ fn get_default_target() -> Result<String, Error> {
}

fn get_workspace_root() -> Result<String, Error> {
let output = Command::new("cargo").args(&["metadata"])
let output = Command::new("cargo").args(["metadata"])
.output().map_err(|_| Error::CargoMetadataFailed)?;

if !output.status.success() {
Expand Down Expand Up @@ -939,7 +939,7 @@ fn collect_macho_data(data: &[u8]) -> Result<Data, Error> {
fn collect_pdb_data(pdb_path: &path::Path, text_size: u64) -> Result<Data, Error> {
use pdb::FallibleIterator;

let file = fs::File::open(&pdb_path).map_err(|_| Error::OpenFailed(pdb_path.to_owned()))?;
let file = fs::File::open(pdb_path).map_err(|_| Error::OpenFailed(pdb_path.to_owned()))?;
let mut pdb = pdb::PDB::open(file)?;

let dbi = pdb.debug_information()?;
Expand Down

0 comments on commit b0e3e41

Please sign in to comment.