diff --git a/ignore/src/lib.rs b/ignore/src/lib.rs index 626588d2..c93a4de7 100644 --- a/ignore/src/lib.rs +++ b/ignore/src/lib.rs @@ -44,6 +44,8 @@ for result in WalkBuilder::new("./").hidden(false).build() { See the documentation for `WalkBuilder` for many other options. */ +#![deny(missing_docs)] + extern crate crossbeam; extern crate globset; #[macro_use] @@ -78,15 +80,35 @@ pub enum Error { /// file partially succeeded. Partial(Vec), /// An error associated with a specific line number. - WithLineNumber { line: u64, err: Box }, + WithLineNumber { + /// The line number. + line: u64, + /// The underlying error. + err: Box, + }, /// An error associated with a particular file path. - WithPath { path: PathBuf, err: Box }, + WithPath { + /// The file path. + path: PathBuf, + /// The underlying error. + err: Box, + }, /// An error associated with a particular directory depth when recursively /// walking a directory. - WithDepth { depth: usize, err: Box }, + WithDepth { + /// The directory depth. + depth: usize, + /// The underlying error. + err: Box, + }, /// An error that occurs when a file loop is detected when traversing /// symbolic links. - Loop { ancestor: PathBuf, child: PathBuf }, + Loop { + /// The ancestor file path in the loop. + ancestor: PathBuf, + /// The child file path in the loop. + child: PathBuf, + }, /// An error that occurs when doing I/O, such as reading an ignore file. Io(io::Error), /// An error that occurs when trying to parse a glob. diff --git a/src/args.rs b/src/args.rs index b999d493..2b87b32c 100644 --- a/src/args.rs +++ b/src/args.rs @@ -24,7 +24,7 @@ use printer::{ColorSpecs, Printer}; use unescape::unescape; use worker::{Worker, WorkerBuilder}; -use {Result, version}; +use Result; /// `Args` are transformed/normalized from `ArgMatches`. #[derive(Debug)] diff --git a/src/main.rs b/src/main.rs index 1ccbdb30..a26812b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![allow(dead_code, unused_imports)] - extern crate bytecount; #[macro_use] extern crate clap; @@ -23,11 +21,10 @@ extern crate termcolor; extern crate winapi; use std::error::Error; -use std::io; use std::io::Write; use std::process; use std::result; -use std::sync::{Arc, Mutex}; +use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::mpsc; use std::thread; @@ -279,20 +276,6 @@ fn get_or_log_dir_entry( } } -fn version() -> String { - let (maj, min, pat) = ( - option_env!("CARGO_PKG_VERSION_MAJOR"), - option_env!("CARGO_PKG_VERSION_MINOR"), - option_env!("CARGO_PKG_VERSION_PATCH"), - ); - match (maj, min, pat) { - (Some(maj), Some(min), Some(pat)) => { - format!("ripgrep {}.{}.{}", maj, min, pat) - } - _ => "".to_owned(), - } -} - fn eprint_nothing_searched() { eprintln!("No files were searched, which means ripgrep probably \ applied a filter you didn't expect. \ diff --git a/termcolor/src/lib.rs b/termcolor/src/lib.rs index fb93fa49..6b6492b0 100644 --- a/termcolor/src/lib.rs +++ b/termcolor/src/lib.rs @@ -67,6 +67,7 @@ try!(bufwtr.print(&buffer)); # Ok(()) } ``` */ + #![deny(missing_docs)] #[cfg(windows)] diff --git a/wincolor/src/lib.rs b/wincolor/src/lib.rs index d5a98f93..44c9e410 100644 --- a/wincolor/src/lib.rs +++ b/wincolor/src/lib.rs @@ -17,6 +17,9 @@ con.reset().unwrap(); println!("This text will be normal."); ``` */ + +#![deny(missing_docs)] + #[cfg(windows)] extern crate kernel32; #[cfg(windows)]