Update to Rust 2018

This commit is contained in:
Alex Lyon
2019-04-24 03:06:03 -07:00
parent ee881618a9
commit 2475c75247
12 changed files with 40 additions and 39 deletions
+1
View File
@@ -2,6 +2,7 @@
name = "findutils"
version = "0.1.0"
authors = ["mcharsley <mcharsley@google.com>"]
edition = "2018"
[dependencies]
glob = "0.3"
+1 -1
View File
@@ -11,7 +11,7 @@ use std::path::Path;
use std::process::Command;
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
enum Arg {
Filename,
+4 -4
View File
@@ -14,7 +14,7 @@ use std::iter::Iterator;
use std::path::PathBuf;
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
/// This matcher contains a collection of other matchers. A file only matches
/// if it matches ALL the contained sub-matchers. For sub-matchers that have
@@ -341,10 +341,10 @@ impl Matcher for NotMatcher {
mod tests {
use walkdir::DirEntry;
use find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::tests::get_dir_entry_for;
use super::*;
use find::matchers::{Matcher, MatcherIO};
use find::tests::FakeDependencies;
use crate::find::matchers::{Matcher, MatcherIO};
use crate::find::tests::FakeDependencies;
/// Simple Matcher impl that has side effects
pub struct HasSideEffects {}
+4 -4
View File
@@ -20,7 +20,7 @@ use std::path::PathBuf;
use std::time::SystemTime;
use walkdir::DirEntry;
use find::{Config, Dependencies};
use super::{Config, Dependencies};
@@ -378,9 +378,9 @@ fn build_matcher_tree(args: &[&str],
#[cfg(test)]
mod tests {
use walkdir::{DirEntry, WalkDir};
use find::Config;
use find::tests::fix_up_slashes;
use find::tests::FakeDependencies;
use crate::find::Config;
use crate::find::tests::fix_up_slashes;
use crate::find::tests::FakeDependencies;
use super::*;
+4 -4
View File
@@ -8,7 +8,7 @@ use glob::Pattern;
use glob::PatternError;
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
/// This matcher makes a case-sensitive comparison of the name against a
/// shell wildcard pattern. See `glob::Pattern` for details on the exact
@@ -63,9 +63,9 @@ impl super::Matcher for CaselessNameMatcher {
#[cfg(test)]
mod tests {
use find::matchers::Matcher;
use find::matchers::tests::get_dir_entry_for;
use find::tests::FakeDependencies;
use crate::find::matchers::Matcher;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::tests::FakeDependencies;
use super::*;
+4 -4
View File
@@ -14,7 +14,7 @@ use std::io::{stderr, Write};
use std::str::FromStr;
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
@@ -321,9 +321,9 @@ impl Matcher for PermMatcher {
#[cfg(test)]
#[cfg(unix)]
mod tests {
use find::matchers::Matcher;
use find::matchers::tests::get_dir_entry_for;
use find::tests::FakeDependencies;
use crate::find::matchers::Matcher;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::tests::FakeDependencies;
use super::*;
use super::parsing;
+5 -5
View File
@@ -6,7 +6,7 @@
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
/// This matcher just prints the name of the file to stdout.
pub struct Printer;
@@ -38,10 +38,10 @@ impl Matcher for Printer {
#[cfg(test)]
mod tests {
use find::matchers::tests::get_dir_entry_for;
use find::matchers::Matcher;
use find::tests::FakeDependencies;
use find::tests::fix_up_slashes;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::matchers::Matcher;
use crate::find::tests::FakeDependencies;
use crate::find::tests::fix_up_slashes;
use super::*;
#[test]
+4 -4
View File
@@ -6,7 +6,7 @@
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
/// This matcher checks the type of the file.
pub struct PruneMatcher;
@@ -30,9 +30,9 @@ impl Matcher for PruneMatcher {
#[cfg(test)]
mod tests {
use find::matchers::Matcher;
use find::matchers::tests::get_dir_entry_for;
use find::tests::FakeDependencies;
use crate::find::matchers::Matcher;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::tests::FakeDependencies;
use super::*;
#[test]
+4 -4
View File
@@ -9,7 +9,7 @@ use std::io::{stderr, Write};
use std::str::FromStr;
use walkdir::DirEntry;
use find::matchers::{ComparableValue, Matcher, MatcherIO};
use super::{ComparableValue, Matcher, MatcherIO};
#[derive(Clone, Copy, Debug)]
enum Unit {
@@ -107,9 +107,9 @@ impl Matcher for SizeMatcher {
#[cfg(test)]
mod tests {
use find::matchers::{ComparableValue, Matcher};
use find::matchers::tests::get_dir_entry_for;
use find::tests::FakeDependencies;
use crate::find::matchers::{ComparableValue, Matcher};
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::tests::FakeDependencies;
use super::*;
// need to explicitly use non-pub members
use super::{byte_size_to_unit_size, Unit};
+4 -4
View File
@@ -11,7 +11,7 @@ use std::io::{stderr, Write};
use std::time::SystemTime;
use walkdir::DirEntry;
use find::matchers::{ComparableValue, Matcher, MatcherIO};
use super::{ComparableValue, Matcher, MatcherIO};
const SECONDS_PER_DAY: i64 = 60 * 60 * 24;
@@ -147,9 +147,9 @@ mod tests {
use tempdir::TempDir;
use walkdir::DirEntry;
use find::matchers::{ComparableValue, Matcher};
use find::matchers::tests::get_dir_entry_for;
use find::tests::FakeDependencies;
use crate::find::matchers::{ComparableValue, Matcher};
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::tests::FakeDependencies;
use super::*;
#[test]
+4 -4
View File
@@ -8,7 +8,7 @@ use std::error::Error;
use std::fs::FileType;
use walkdir::DirEntry;
use find::matchers::{Matcher, MatcherIO};
use super::{Matcher, MatcherIO};
/// This matcher checks the type of the file.
pub struct TypeMatcher {
@@ -41,9 +41,9 @@ impl Matcher for TypeMatcher {
#[cfg(test)]
mod tests {
use find::matchers::Matcher;
use find::matchers::tests::get_dir_entry_for;
use find::tests::FakeDependencies;
use crate::find::matchers::Matcher;
use crate::find::matchers::tests::get_dir_entry_for;
use crate::find::tests::FakeDependencies;
use super::*;
#[test]
+1 -1
View File
@@ -212,7 +212,7 @@ mod tests {
use std::vec::Vec;
use tempdir::TempDir;
use find::matchers::MatcherIO;
use crate::find::matchers::MatcherIO;
use super::*;