From a8bb180a6a20b7b1dda7682b3fb5857e230ccb4c Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 10:28:52 +0200 Subject: [PATCH] [No-auto] lib/entry/view: Fix Clippy warnings Signed-off-by: flip1995 Signed-off-by: Matthias Beyer --- lib/entry/libimagentryview/src/builtin/md.rs | 4 ++-- lib/entry/libimagentryview/src/builtin/stdout.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/entry/libimagentryview/src/builtin/md.rs b/lib/entry/libimagentryview/src/builtin/md.rs index 839ba60d..53e98775 100644 --- a/lib/entry/libimagentryview/src/builtin/md.rs +++ b/lib/entry/libimagentryview/src/builtin/md.rs @@ -59,10 +59,10 @@ impl<'a> Viewer for MarkdownViewer<'a> { ::mdcat::push_tty(sink, TerminalCapabilities::ansi(), - self.termsize.clone(), + self.termsize, parser, base_dir, - self.resource_access.clone(), + self.resource_access, syntax_set) .map_err(|e| e.compat()) .map_err(::failure::Error::from) diff --git a/lib/entry/libimagentryview/src/builtin/stdout.rs b/lib/entry/libimagentryview/src/builtin/stdout.rs index 2706ca4a..6df89abe 100644 --- a/lib/entry/libimagentryview/src/builtin/stdout.rs +++ b/lib/entry/libimagentryview/src/builtin/stdout.rs @@ -60,7 +60,7 @@ impl Viewer for StdoutViewer { where W: Write { if self.view_header { - let header = to_string(e.get_header()).unwrap_or(String::from("TOML Parser error")); + let header = to_string(e.get_header()).unwrap_or_else(|_| String::from("TOML Parser error")); writeln!(sink, "{}", header)?; }