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

Edition upgrade #383

Merged
merged 3 commits into from
Jan 7, 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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ name = "fd-find"
readme = "README.md"
repository = "https://github.com/sharkdp/fd"
version = "7.2.0"
edition= "2018"

[[bin]]
name = "fd"
Expand Down
4 changes: 0 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
// notice may not be copied, modified, or distributed except
// according to those terms.

#[macro_use]
extern crate clap;
extern crate version_check;

use clap::Shell;
use std::fs;
use std::io::{self, Write};
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// according to those terms.
use std::collections::HashMap;

use clap::{App, AppSettings, Arg};
use clap::{crate_version, App, AppSettings, Arg};

struct Help {
short: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion src/exec/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// according to those terms.

use super::CommandTemplate;
use crate::walk::WorkerResult;
use std::path::PathBuf;
use std::sync::mpsc::Receiver;
use std::sync::{Arc, Mutex};
use walk::WorkerResult;

/// An event loop that listens for inputs from the `rx` receiver. Each received input will
/// generate a command with the supplied command template. The generated command will then
Expand Down
1 change: 1 addition & 0 deletions src/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::sync::{Arc, Mutex};

use lazy_static::lazy_static;
use regex::Regex;

use self::command::execute_command;
Expand Down
1 change: 1 addition & 0 deletions src/internal/filter/size.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use lazy_static::lazy_static;
use regex::Regex;

lazy_static! {
Expand Down
4 changes: 2 additions & 2 deletions src/internal/opts.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use exec::CommandTemplate;
use internal::{
use crate::exec::CommandTemplate;
use crate::internal::{
filter::{SizeFilter, TimeFilter},
FileTypes,
};
Expand Down
19 changes: 2 additions & 17 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@
// notice may not be copied, modified, or distributed except
// according to those terms.

extern crate ansi_term;
extern crate atty;
#[macro_use]
extern crate clap;
extern crate ignore;
#[macro_use]
extern crate lazy_static;
extern crate humantime;
#[cfg(all(unix, not(target_os = "redox")))]
extern crate libc;
extern crate lscolors;
extern crate num_cpus;
extern crate regex;
extern crate regex_syntax;

#[macro_use]
mod internal;

Expand All @@ -41,8 +26,8 @@ use atty::Stream;
use lscolors::LsColors;
use regex::{RegexBuilder, RegexSetBuilder};

use exec::CommandTemplate;
use internal::{
use crate::exec::CommandTemplate;
use crate::internal::{
filter::{SizeFilter, TimeFilter},
opts::FdOptions,
pattern_has_uppercase_char, transform_args_with_exec, FileTypes,
Expand Down
4 changes: 2 additions & 2 deletions src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
// notice may not be copied, modified, or distributed except
// according to those terms.

use exit_codes::ExitCode;
use internal::opts::FdOptions;
use crate::exit_codes::ExitCode;
use crate::internal::opts::FdOptions;
use lscolors::{LsColors, Style};

use std::io::{self, Write};
Expand Down
12 changes: 5 additions & 7 deletions src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
// notice may not be copied, modified, or distributed except
// according to those terms.

extern crate ctrlc;

use exec;
use exit_codes::ExitCode;
use fshelper;
use internal::{opts::FdOptions, MAX_BUFFER_LENGTH};
use output;
use crate::exec;
use crate::exit_codes::ExitCode;
use crate::fshelper;
use crate::internal::{opts::FdOptions, MAX_BUFFER_LENGTH};
use crate::output;

use std::error::Error;
use std::path::PathBuf;
Expand Down
5 changes: 1 addition & 4 deletions tests/testenv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ use std::os::unix;
#[cfg(windows)]
use std::os::windows;

extern crate diff;
extern crate tempdir;

use self::tempdir::TempDir;
use tempdir::TempDir;

/// Environment for the integration tests.
pub struct TestEnv {
Expand Down
6 changes: 1 addition & 5 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@

//! Integration tests for the CLI interface of fd.

extern crate filetime;
extern crate humantime;
extern crate regex;

mod testenv;

use crate::testenv::TestEnv;
use regex::escape;
use std::fs;
use std::io::Write;
use std::path::Path;
use std::time::{Duration, SystemTime};
use testenv::TestEnv;

static DEFAULT_DIRS: &'static [&'static str] = &["one/two/three", "one/two/three/directory_foo"];

Expand Down