summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index d40d0fe..ceb34da 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -27,9 +27,13 @@ impl Args {
fn whom(&self) -> Result<String, HelloError> {
if let Some(filename) = &self.filename {
let data = read(&filename)
- .map_err(|e| HelloError::Read(filename.clone(), e))?;
+ .map_err(|e| {
+ HelloError::Read(filename.clone(), e)
+ })?;
let whom = String::from_utf8(data)
- .map_err(|e| HelloError::Utf8(filename.clone(), e))?;
+ .map_err(|e| {
+ HelloError::Utf8(filename.clone(), e)
+ })?;
Ok(whom.trim().to_string())
} else {
Ok(self.whom.clone())