From 254931e15d785e21a40593a16a24eecf8cef545f Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sat, 21 Sep 2019 14:02:43 +0200 Subject: Rename Err => Error --- src/walk.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/walk.rs') diff --git a/src/walk.rs b/src/walk.rs index 25a2f73..e982549 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -9,14 +9,14 @@ use rayon::{self, prelude::*}; use crate::unique_id::{generate_unique_id, UniqueID}; -pub enum Err { +pub enum Error { NoMetadataForPath(PathBuf), CouldNotReadDir(PathBuf), } enum Message { SizeEntry(Option, u64), - Error { err: Err }, + Error { error: Error }, } fn walk(tx: channel::Sender, entries: &[PathBuf]) { @@ -41,7 +41,7 @@ fn walk(tx: channel::Sender, entries: &[PathBuf]) { Err(_) => { tx_ref .send(Message::Error { - err: Err::CouldNotReadDir(entry.clone()), + error: Error::CouldNotReadDir(entry.clone()), }) .unwrap(); } @@ -52,7 +52,7 @@ fn walk(tx: channel::Sender, entries: &[PathBuf]) { } else { tx_ref .send(Message::Error { - err: Err::NoMetadataForPath(entry.clone()), + error: Error::NoMetadataForPath(entry.clone()), }) .unwrap(); }; @@ -72,13 +72,13 @@ impl<'a> Walk<'a> { } } - pub fn run(&self) -> (u64, Vec) { + pub fn run(&self) -> (u64, Vec) { let (tx, rx) = channel::unbounded(); let receiver_thread = thread::spawn(move || { let mut total = 0; let mut ids = HashSet::new(); - let mut error_messages: Vec = Vec::new(); + let mut error_messages: Vec = Vec::new(); for msg in rx { match msg { Message::SizeEntry(unique_id, size) => { @@ -91,8 +91,8 @@ impl<'a> Walk<'a> { total += size; } } - Message::Error { err } => { - error_messages.push(err); + Message::Error { error } => { + error_messages.push(error); } } } -- cgit v1.2.3