Skip to content

Commit 8ccff86

Browse files
authored
Merge pull request ogham#450 from Bond-009/2018
Update to Rust 2018
2 parents 44664bf + 8b60285 commit 8ccff86

40 files changed

+293
-311
lines changed

Cargo.lock

Lines changed: 80 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "exa"
33
version = "0.9.0"
44
authors = [ "Benjamin Sago <ogham@bsago.me>" ]
55
build = "build.rs"
6+
edition = "2018"
67

78
description = "A modern replacement for ls"
89
homepage = "https://the.exa.website/"

src/exa.rs

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,22 @@
11
#![warn(trivial_casts, trivial_numeric_casts)]
22
#![warn(unused_results)]
33

4-
extern crate ansi_term;
5-
extern crate datetime;
6-
extern crate glob;
7-
extern crate libc;
8-
extern crate locale;
9-
extern crate natord;
10-
extern crate num_cpus;
11-
extern crate number_prefix;
12-
extern crate scoped_threadpool;
13-
extern crate term_grid;
14-
extern crate unicode_width;
15-
extern crate users;
16-
extern crate zoneinfo_compiled;
17-
extern crate term_size;
18-
19-
#[cfg(feature="git")] extern crate git2;
20-
21-
#[macro_use] extern crate lazy_static;
22-
#[macro_use] extern crate log;
23-
24-
254
use std::env::var_os;
265
use std::ffi::{OsStr, OsString};
276
use std::io::{stderr, Write, Result as IOResult};
287
use std::path::{Component, PathBuf};
298

309
use ansi_term::{ANSIStrings, Style};
3110

32-
use fs::{Dir, File};
33-
use fs::feature::ignore::IgnoreCache;
34-
use fs::feature::git::GitCache;
35-
use options::{Options, Vars};
36-
pub use options::vars;
37-
pub use options::Misfire;
38-
use output::{escape, lines, grid, grid_details, details, View, Mode};
11+
use log::debug;
12+
13+
use crate::fs::{Dir, File};
14+
use crate::fs::feature::ignore::IgnoreCache;
15+
use crate::fs::feature::git::GitCache;
16+
use crate::options::{Options, Vars};
17+
pub use crate::options::vars;
18+
pub use crate::options::Misfire;
19+
use crate::output::{escape, lines, grid, grid_details, details, View, Mode};
3920

4021
mod fs;
4122
mod info;
@@ -91,7 +72,7 @@ fn git_options(options: &Options, args: &[&OsStr]) -> Option<GitCache> {
9172
}
9273

9374
fn ignore_cache(options: &Options) -> Option<IgnoreCache> {
94-
use fs::filter::GitIgnore;
75+
use crate::fs::filter::GitIgnore;
9576

9677
match options.filter.git_ignore {
9778
GitIgnore::CheckAndIgnore => Some(IgnoreCache::new()),

src/fs/dir.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ use std::fs;
33
use std::path::{Path, PathBuf};
44
use std::slice::Iter as SliceIter;
55

6-
use fs::File;
7-
use fs::feature::ignore::IgnoreCache;
6+
use log::info;
7+
8+
use crate::fs::File;
9+
use crate::fs::feature::ignore::IgnoreCache;
810

911

1012
/// A **Dir** provides a cached list of the file paths in a directory that's

src/fs/feature/git.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ use std::path::{Path, PathBuf};
44
use std::sync::Mutex;
55

66
use git2;
7+
use log::{debug, error, info, warn};
78

8-
use fs::fields as f;
9+
use crate::fs::fields as f;
910

1011

1112
/// A **Git cache** is assembled based on the user’s input arguments.

src/fs/feature/ignore.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use std::io::Read;
88
use std::path::{Path, PathBuf};
99
use std::sync::RwLock;
1010

11-
use fs::filter::IgnorePatterns;
11+
use log::debug;
12+
13+
use crate::fs::filter::IgnorePatterns;
1214

1315

1416
/// An **ignore cache** holds sets of glob patterns paired with the

src/fs/feature/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub mod git {
88
use std::iter::FromIterator;
99
use std::path::{Path, PathBuf};
1010

11-
use fs::fields as f;
11+
use crate::fs::fields as f;
1212

1313

1414
pub struct GitCache;

src/fs/file.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ use std::os::unix::fs::{MetadataExt, PermissionsExt, FileTypeExt};
77
use std::path::{Path, PathBuf};
88
use std::time::{UNIX_EPOCH, Duration};
99

10-
use fs::dir::Dir;
11-
use fs::fields as f;
12-
use options::Misfire;
10+
use log::{debug, error};
11+
12+
use crate::fs::dir::Dir;
13+
use crate::fs::fields as f;
14+
use crate::options::Misfire;
1315

1416

1517
/// A **File** is a wrapper around one of Rust's Path objects, along with

src/fs/filter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::path::Path;
88
use glob;
99
use natord;
1010

11-
use fs::File;
12-
use fs::DotFilter;
11+
use crate::fs::File;
12+
use crate::fs::DotFilter;
1313

1414

1515
/// The **file filter** processes a list of files before displaying them to

src/info/filetype.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
77
use ansi_term::Style;
88

9-
use fs::File;
10-
use output::file_name::FileColours;
11-
use output::icons::FileIcon;
9+
use crate::fs::File;
10+
use crate::output::file_name::FileColours;
11+
use crate::output::icons::FileIcon;
1212

1313

1414
#[derive(Debug, Default, PartialEq)]
@@ -119,7 +119,7 @@ impl FileColours for FileExtensions {
119119

120120
impl FileIcon for FileExtensions {
121121
fn icon_file(&self, file: &File) -> Option<char> {
122-
use output::icons::Icons;
122+
use crate::output::icons::Icons;
123123

124124
Some(match file {
125125
f if self.is_music(f) || self.is_lossless(f) => Icons::Audio.value(),

0 commit comments

Comments
 (0)