From cb9068d7fbd3e83548fe1a59e8a760d26250aef1 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:51:24 +0200 Subject: [PATCH] [Auto] lib/entry/view: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- lib/entry/libimagentryview/src/builtin/plain.rs | 6 +++--- lib/entry/libimagentryview/src/builtin/stdout.rs | 8 ++++---- lib/entry/libimagentryview/src/viewer.rs | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/entry/libimagentryview/src/builtin/plain.rs b/lib/entry/libimagentryview/src/builtin/plain.rs index 12da248a..dc454c6d 100644 --- a/lib/entry/libimagentryview/src/builtin/plain.rs +++ b/lib/entry/libimagentryview/src/builtin/plain.rs @@ -32,7 +32,7 @@ impl PlainViewer { pub fn new(show_header: bool) -> PlainViewer { PlainViewer { - show_header: show_header, + show_header, } } @@ -44,9 +44,9 @@ impl Viewer for PlainViewer { where W: Write { if self.show_header { - let _ = writeln!(sink, "{}", e.get_header())?; + writeln!(sink, "{}", e.get_header())?; } - let _ = writeln!(sink, "{}", e.get_content())?; + writeln!(sink, "{}", e.get_content())?; Ok(()) } diff --git a/lib/entry/libimagentryview/src/builtin/stdout.rs b/lib/entry/libimagentryview/src/builtin/stdout.rs index 11237fbb..2706ca4a 100644 --- a/lib/entry/libimagentryview/src/builtin/stdout.rs +++ b/lib/entry/libimagentryview/src/builtin/stdout.rs @@ -37,8 +37,8 @@ impl StdoutViewer { pub fn new(view_header: bool, view_content: bool) -> StdoutViewer { StdoutViewer { - view_header: view_header, - view_content: view_content, + view_header, + view_content, trim_right: false, wrap_content: None, } @@ -61,7 +61,7 @@ impl Viewer for StdoutViewer { { if self.view_header { let header = to_string(e.get_header()).unwrap_or(String::from("TOML Parser error")); - let _ = writeln!(sink, "{}", header)?; + writeln!(sink, "{}", header)?; } if self.view_content { @@ -74,7 +74,7 @@ impl Viewer for StdoutViewer { match self.wrap_content { Some(limit) => for line in ::textwrap::wrap(content, limit).iter() { - let _ = writeln!(sink, "{}", line)?; + writeln!(sink, "{}", line)?; }, None => writeln!(sink, "{}", content)?, } diff --git a/lib/entry/libimagentryview/src/viewer.rs b/lib/entry/libimagentryview/src/viewer.rs index 07b2258a..9c11d7d4 100644 --- a/lib/entry/libimagentryview/src/viewer.rs +++ b/lib/entry/libimagentryview/src/viewer.rs @@ -35,7 +35,7 @@ pub trait Viewer { W: Write { for entry in entries { - let _ = self.view_entry(entry.deref(), sink)?; + self.view_entry(entry.deref(), sink)?; } Ok(()) }