Use Rust 2018
This commit is contained in:
parent
0eb83a6387
commit
b842c149b6
|
@ -11,6 +11,7 @@ keywords = ["watcher", "inotify", "fsevents", "kqueue"]
|
|||
categories = ["command-line-utilities"]
|
||||
license = "Apache-2.0"
|
||||
exclude = ["/ci/*", "/pkg/*", "/.travis.yml", "/Makefile", "/appveyor.yml"]
|
||||
edition = "2018"
|
||||
|
||||
[badges]
|
||||
appveyor = { repository = "watchexec/watchexec" }
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
//! ```
|
||||
|
||||
use clap::{App, Arg, Error};
|
||||
use error;
|
||||
use crate::error;
|
||||
use std::{
|
||||
ffi::OsString,
|
||||
path::{PathBuf, MAIN_SEPARATOR},
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
use clap;
|
||||
use globset;
|
||||
use notify;
|
||||
use std::{error::Error as StdError, fmt, io, sync::PoisonError};
|
||||
|
||||
pub type Result<T> = ::std::result::Result<T, Error>;
|
||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -13,20 +13,10 @@
|
|||
extern crate clap;
|
||||
#[macro_use]
|
||||
extern crate derive_builder;
|
||||
extern crate env_logger;
|
||||
extern crate globset;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate notify;
|
||||
|
||||
#[cfg(windows)]
|
||||
extern crate kernel32;
|
||||
#[cfg(unix)]
|
||||
extern crate nix;
|
||||
#[cfg(windows)]
|
||||
extern crate winapi;
|
||||
|
||||
pub mod cli;
|
||||
pub mod error;
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
extern crate glob;
|
||||
|
||||
use error;
|
||||
use gitignore::Gitignore;
|
||||
use crate::error;
|
||||
use crate::gitignore::Gitignore;
|
||||
use globset::{Glob, GlobSet, GlobSetBuilder};
|
||||
use ignore::Ignore;
|
||||
use crate::ignore::Ignore;
|
||||
use std::path::Path;
|
||||
|
||||
pub struct NotificationFilter {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use error::Result;
|
||||
use pathop::PathOp;
|
||||
use crate::error::Result;
|
||||
use crate::pathop::PathOp;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
@ -59,8 +59,8 @@ mod imp {
|
|||
//use super::wrap_commands;
|
||||
use nix::libc::*;
|
||||
use nix::{self, Error};
|
||||
use pathop::PathOp;
|
||||
use signal::Signal;
|
||||
use crate::pathop::PathOp;
|
||||
use crate::signal::Signal;
|
||||
use std::io::{self, Result};
|
||||
use std::process::Command;
|
||||
use std::sync::*;
|
||||
|
@ -146,7 +146,7 @@ mod imp {
|
|||
}
|
||||
|
||||
pub fn signal(&self, signal: Signal) {
|
||||
use signal::ConvertToLibc;
|
||||
use crate::signal::ConvertToLibc;
|
||||
|
||||
let signo = signal.convert_to_libc();
|
||||
debug!("Sending {:?} (int: {}) to child process", signal, signo);
|
||||
|
@ -176,8 +176,8 @@ mod imp {
|
|||
mod imp {
|
||||
//use super::wrap_commands;
|
||||
use kernel32::*;
|
||||
use pathop::PathOp;
|
||||
use signal::Signal;
|
||||
use crate::pathop::PathOp;
|
||||
use crate::signal::Signal;
|
||||
use std::io;
|
||||
use std::io::Result;
|
||||
use std::mem;
|
||||
|
|
22
src/run.rs
22
src/run.rs
|
@ -1,15 +1,11 @@
|
|||
use cli::{clear_screen, Args};
|
||||
use env_logger;
|
||||
use error::{Error, Result};
|
||||
use gitignore;
|
||||
use ignore;
|
||||
use log;
|
||||
use notification_filter::NotificationFilter;
|
||||
#[cfg(target_os = "linux")]
|
||||
use notify;
|
||||
use pathop::PathOp;
|
||||
use process::{self, Process};
|
||||
use signal::{self, Signal};
|
||||
use crate::cli::{clear_screen, Args};
|
||||
use crate::error::{Error, Result};
|
||||
use crate::gitignore;
|
||||
use crate::ignore;
|
||||
use crate::notification_filter::NotificationFilter;
|
||||
use crate::pathop::PathOp;
|
||||
use crate::process::{self, Process};
|
||||
use crate::signal::{self, Signal};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs::canonicalize,
|
||||
|
@ -20,7 +16,7 @@ use std::{
|
|||
},
|
||||
time::Duration,
|
||||
};
|
||||
use watcher::{Event, Watcher};
|
||||
use crate::watcher::{Event, Watcher};
|
||||
|
||||
fn init_logger(debug: bool) {
|
||||
let mut log_builder = env_logger::Builder::new();
|
||||
|
|
Loading…
Reference in New Issue