Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/walkdir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-01-11 21:38:37 +0300
committerAndrew Gallant <jamslam@gmail.com>2020-01-11 21:39:17 +0300
commited87b1ee2157cb6e9ff91a403d19ca2ef70bad13 (patch)
tree942f542f328866c17ac513bf534aacf701abada5
parentc584a1d56c5f4b64019e1a4d70c5355e3212cc9b (diff)
edition: switch to Rust 2018
-rw-r--r--Cargo.toml1
-rw-r--r--src/dent.rs6
-rw-r--r--src/error.rs4
-rw-r--r--src/lib.rs22
-rw-r--r--src/tests/recursive.rs6
-rw-r--r--src/tests/util.rs2
6 files changed, 18 insertions, 23 deletions
diff --git a/Cargo.toml b/Cargo.toml
index d9c5422..31ccee6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,6 +11,7 @@ keywords = ["directory", "recursive", "walk", "iterator"]
categories = ["filesystem"]
license = "Unlicense/MIT"
exclude = ["/ci/*", "/.travis.yml", "/appveyor.yml"]
+edition = "2018"
[badges]
travis-ci = { repository = "BurntSushi/walkdir" }
diff --git a/src/dent.rs b/src/dent.rs
index 2b2159b..a28ed3d 100644
--- a/src/dent.rs
+++ b/src/dent.rs
@@ -3,8 +3,8 @@ use std::fmt;
use std::fs::{self, FileType};
use std::path::{Path, PathBuf};
-use error::Error;
-use Result;
+use crate::error::Error;
+use crate::Result;
/// A directory entry.
///
@@ -352,7 +352,7 @@ impl Clone for DirEntry {
}
impl fmt::Debug for DirEntry {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "DirEntry({:?})", self.path)
}
}
diff --git a/src/error.rs b/src/error.rs
index a86015e..3fb619c 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -3,7 +3,7 @@ use std::fmt;
use std::io;
use std::path::{Path, PathBuf};
-use DirEntry;
+use crate::DirEntry;
/// An error produced by recursively walking a directory.
///
@@ -221,7 +221,7 @@ impl error::Error for Error {
}
impl fmt::Display for Error {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.inner {
ErrorInner::Io { path: None, ref err } => err.fmt(f),
ErrorInner::Io { path: Some(ref path), ref err } => write!(
diff --git a/src/lib.rs b/src/lib.rs
index ee5adda..5132dd5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -107,16 +107,7 @@ for entry in walker.filter_entry(|e| !is_hidden(e)) {
#![allow(unknown_lints)]
#[cfg(test)]
-#[macro_use]
-extern crate doc_comment;
-extern crate same_file;
-#[cfg(windows)]
-extern crate winapi;
-#[cfg(windows)]
-extern crate winapi_util;
-
-#[cfg(test)]
-doctest!("../README.md");
+doc_comment::doctest!("../README.md");
use std::cmp::{min, Ordering};
use std::fmt;
@@ -128,10 +119,10 @@ use std::vec;
use same_file::Handle;
-pub use dent::DirEntry;
+pub use crate::dent::DirEntry;
#[cfg(unix)]
-pub use dent::DirEntryExt;
-pub use error::Error;
+pub use crate::dent::DirEntryExt;
+pub use crate::error::Error;
mod dent;
mod error;
@@ -262,7 +253,10 @@ struct WalkDirOptions {
}
impl fmt::Debug for WalkDirOptions {
- fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> {
+ fn fmt(
+ &self,
+ f: &mut fmt::Formatter<'_>,
+ ) -> result::Result<(), fmt::Error> {
let sorter_str = if self.sorter.is_some() {
// FnMut isn't `Debug`
"Some(...)"
diff --git a/src/tests/recursive.rs b/src/tests/recursive.rs
index 413b2f1..bbb1ce1 100644
--- a/src/tests/recursive.rs
+++ b/src/tests/recursive.rs
@@ -1,12 +1,12 @@
use std::fs;
use std::path::PathBuf;
-use tests::util::Dir;
-use WalkDir;
+use crate::tests::util::Dir;
+use crate::WalkDir;
#[test]
fn send_sync_traits() {
- use {FilterEntry, IntoIter};
+ use crate::{FilterEntry, IntoIter};
fn assert_send<T: Send>() {}
fn assert_sync<T: Sync>() {}
diff --git a/src/tests/util.rs b/src/tests/util.rs
index b37f889..fdf06f5 100644
--- a/src/tests/util.rs
+++ b/src/tests/util.rs
@@ -5,7 +5,7 @@ use std::io;
use std::path::{Path, PathBuf};
use std::result;
-use {DirEntry, Error};
+use crate::{DirEntry, Error};
/// Create an error from a format!-like syntax.
#[macro_export]