Skip to content

Commit c3a5111

Browse files
jyn514calebcartwright
authored andcommitted
Fix some clippy warnings
This commit can be replicated with `cargo clippy --fix -Z unstable-options && cargo +nightly-2021-02-10 fmt`.
1 parent 432e09e commit c3a5111

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

src/bin/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::{format_err, Result};
2-
use env_logger;
2+
33
use io::Error as IoError;
44
use thiserror::Error;
55

@@ -233,7 +233,7 @@ fn execute(opts: &Options) -> Result<i32> {
233233
let file = PathBuf::from(path);
234234
let file = file.canonicalize().unwrap_or(file);
235235

236-
let (config, _) = load_config(Some(file.parent().unwrap()), Some(options.clone()))?;
236+
let (config, _) = load_config(Some(file.parent().unwrap()), Some(options))?;
237237
let toml = config.all_options().to_toml()?;
238238
io::stdout().write_all(toml.as_bytes())?;
239239

@@ -565,7 +565,7 @@ impl GetOptsOptions {
565565
options.inline_config = matches
566566
.opt_strs("config")
567567
.iter()
568-
.flat_map(|config| config.split(","))
568+
.flat_map(|config| config.split(','))
569569
.map(
570570
|key_val| match key_val.char_indices().find(|(_, ch)| *ch == '=') {
571571
Some((middle, _)) => {
@@ -681,7 +681,7 @@ impl CliOptions for GetOptsOptions {
681681
}
682682

683683
fn config_path(&self) -> Option<&Path> {
684-
self.config_path.as_ref().map(|p| &**p)
684+
self.config_path.as_deref()
685685
}
686686
}
687687

src/cargo-fmt/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
#![deny(warnings)]
44

5-
use cargo_metadata;
6-
75
use std::cmp::Ordering;
86
use std::collections::{BTreeMap, BTreeSet};
97
use std::env;

src/format-diff/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
#![deny(warnings)]
66

7-
use env_logger;
87
#[macro_use]
98
extern crate log;
10-
use regex;
9+
1110
use serde::{Deserialize, Serialize};
1211
use serde_json as json;
1312
use thiserror::Error;

src/git-rustfmt/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
77
use std::process::Command;
88
use std::str::FromStr;
99

10-
use env_logger;
1110
use getopts::{Matches, Options};
1211
use rustfmt_nightly as rustfmt;
1312

0 commit comments

Comments
 (0)