Apply clippy suggested fixes

This commit is contained in:
Matt Green 2016-10-30 12:37:34 -04:00
parent 69eedd4cc5
commit 8f916c495f
3 changed files with 5 additions and 3 deletions

View File

@ -28,6 +28,8 @@ pub fn clear_screen() {
let _ = Command::new("clear").status();
}
#[allow(unknown_lints)]
#[allow(or_fun_call)]
pub fn get_args() -> Args {
let args = App::new("watchexec")
.version(crate_version!())

View File

@ -130,7 +130,7 @@ fn main() {
while !interrupt_handler::interrupt_requested() {
if let Some(paths) = wait(&rx, &interrupt_rx, &filter) {
if let Some(path) = paths.iter().nth(0) {
if let Some(path) = paths.get(0) {
debug!("Path updated: {:?}", path);
}

View File

@ -202,7 +202,7 @@ impl ProcessReaper {
}
}
fn get_single_updated_path<'a>(paths: &'a [PathBuf]) -> Option<&'a str> {
fn get_single_updated_path(paths: &[PathBuf]) -> Option<&str> {
paths.get(0).and_then(|p| p.to_str())
}
@ -238,7 +238,7 @@ fn get_longest_common_path(paths: &[PathBuf]) -> Option<String> {
cur_node = borrowed.children
.entry(component)
.or_insert(Rc::new(RefCell::new(TreeNode {
.or_insert_with(|| Rc::new(RefCell::new(TreeNode {
value: component,
children: BTreeMap::new(),
})))