From dfe861a5e703d9b928108cb770690b5ee59142c7 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Thu, 12 Jan 2023 15:06:43 +0900 Subject: [PATCH] cli: remove unused Formatter::write_from_reader() It's unused, and we can use std::io::copy() instead. --- src/formatter.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/formatter.rs b/src/formatter.rs index 0b4a7777a..b1077b223 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -14,7 +14,7 @@ use std::collections::HashMap; use std::io; -use std::io::{Error, Read, Write}; +use std::io::{Error, Write}; use std::sync::Arc; // Lets the caller label strings and translates the labels to colors @@ -27,12 +27,6 @@ pub trait Formatter: Write { self.write_all(text.as_bytes()) } - fn write_from_reader(&mut self, reader: &mut dyn Read) -> io::Result<()> { - let mut buffer = vec![]; - reader.read_to_end(&mut buffer).unwrap(); - self.write_all(&buffer) - } - fn add_label(&mut self, label: &str) -> io::Result<()>; fn remove_label(&mut self) -> io::Result<()>;