Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 2018 edition and remove unused crate chrono #19

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "cargo-sweep"
description = "A tool for cleaning unused build files created by Cargo"
version = "0.3.0"
edition = "2018"
authors = ["holmgr <viktor.holmgren@gmail.com>"]
keywords = ["tool", "cli", "cargo"]
license = "MIT"
Expand All @@ -12,7 +13,6 @@ readme = "README.md"
clap = "2.32.0"
walkdir = "2"
failure = "0.1.3"
chrono = "0.4.6"
log = "0.4.6"
fern = { version = "0.5", features = ["colored"] }
cargo_metadata = "0.6.1"
Expand Down
2 changes: 2 additions & 0 deletions src/fingerprint.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![allow(deprecated)]
use failure::{bail, Error};
use log::{debug, info, warn};
use serde_derive::Deserialize;
use serde_json::from_str;
use std::collections::HashSet;
use std::hash::{Hash, Hasher, SipHasher};
Expand Down
20 changes: 3 additions & 17 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
extern crate chrono;
extern crate clap;
extern crate failure;
extern crate walkdir;
#[macro_use]
extern crate log;
extern crate cargo_metadata;
extern crate fern;
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_json;

use clap::{App, Arg, ArgGroup, SubCommand};
use fern::colors::{Color, ColoredLevelConfig};
use fingerprint::{remove_not_built_with, remove_older_then};
use log::{debug, error, info};
use std::{
env,
path::{Path, PathBuf},
Expand All @@ -24,6 +11,7 @@ use walkdir::WalkDir;
mod fingerprint;
mod stamp;
mod util;
use self::fingerprint::{remove_not_built_with, remove_older_then};
use self::stamp::Timestamp;
use self::util::format_bytes;

Expand Down Expand Up @@ -87,9 +75,7 @@ fn is_hidden(entry: &walkdir::DirEntry) -> bool {
fn find_cargo_projects(root: &Path, include_hidden: bool) -> Vec<PathBuf> {
let mut target_paths = std::collections::BTreeSet::new();

let mut iter = WalkDir::new(root)
.min_depth(1)
.into_iter();
let mut iter = WalkDir::new(root).min_depth(1).into_iter();

while let Some(entry) = iter.next() {
if let Ok(entry) = entry {
Expand Down
1 change: 1 addition & 0 deletions src/stamp.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use failure::Error;
use serde_derive::{Deserialize, Serialize};
use serde_json::{from_str, to_string};
use std::{
fs::{remove_file, File},
Expand Down