[Auto] lib/entry/view: Fix Clippy warnings
Signed-off-by: flip1995 <hello@philkrones.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
19a1c41924
commit
cb9068d7fb
3 changed files with 8 additions and 8 deletions
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
|
@ -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)?,
|
||||
}
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue