Skip to content

Commit f3f1988

Browse files
committed
Pass cargo clippy
1 parent 5aaad93 commit f3f1988

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ language: rust
33
cache: cargo
44
rust:
55
- nightly
6-
- nightly-2016-10-18
6+
- nightly-2018-12-04
77
- beta
88
- stable
99
matrix:
@@ -12,9 +12,10 @@ matrix:
1212
script:
1313
- |
1414
if [[ "$TRAVIS_RUST_VERSION" == nightly* ]]; then
15-
cargo build --verbose --features="clippy"
15+
cargo clippy
16+
cargo build --verbose
1617
else
17-
cargo build --verbose
18+
cargo build --verbose
1819
fi
1920
addons:
2021
apt:

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ serde_derive = "1.0"
2727
serde_json = "1.0"
2828
sha2 = "0.8"
2929
toml = "0.4"
30-
clippy = {version= "0.0.302", optional = true}
3130

3231

3332
[features]

src/main.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
8-
#![cfg_attr(feature = "clippy", feature(plugin))]
9-
#![cfg_attr(feature = "clippy", plugin(clippy))]
10-
#![cfg_attr(not(feature = "clippy"), allow(unknown_lints))]//ignore clippy lints on stable
118
#![deny(warnings)]
129
extern crate serde_json;
1310
extern crate router;
@@ -73,7 +70,7 @@ impl Config {
7370

7471
let mut file = match File::open(&path) {
7572
Ok(file) => file,
76-
Err(_) => panic!("Could not find config file {}!", path),
73+
Err(_e) => panic!("Could not find config file {}!", path),
7774
};
7875
file.read_to_string(&mut config_toml)
7976
.unwrap_or_else(|err| panic!("Error while reading config: [{}]", err));
@@ -357,7 +354,7 @@ fn main() {
357354
let mirror = Mirror {
358355
remote_api: config.remote_api,
359356
crates_path: base_path,
360-
index_path: index_path,
357+
index_path,
361358
active_downloads: Arc::new(RwLock::new(HashSet::new())),
362359
};
363360
let mut router = Router::new();
@@ -371,7 +368,7 @@ fn main() {
371368
.origin
372369
.map(|o| o.url)
373370
.clone()
374-
.unwrap_or(format!("file://{}", base_dir.to_str().unwrap())));
371+
.unwrap_or_else(|| format!("file://{}", base_dir.to_str().unwrap())));
375372

376373
Iron::new(router)
377374
.http(url)

0 commit comments

Comments
 (0)