Skip to content

Commit

Permalink
Only require necessary traits
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Jul 13, 2023
1 parent c9d0e64 commit 3c842b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/agama-cli/src/printers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct JsonPrinter<T, W> {
writer: W,
}

impl<T: Serialize + Debug, W: Write> Printer<T, W> for JsonPrinter<T, W> {
impl<T: Serialize, W: Write> Printer<T, W> for JsonPrinter<T, W> {
fn print(mut self: Box<Self>) -> anyhow::Result<()> {
let json = serde_json::to_string(&self.content)?;
Ok(writeln!(self.writer, "{}", json)?)
Expand All @@ -57,7 +57,7 @@ pub struct TextPrinter<T, W> {
writer: W,
}

impl<T: Serialize + Debug, W: Write> Printer<T, W> for TextPrinter<T, W> {
impl<T: Debug, W: Write> Printer<T, W> for TextPrinter<T, W> {
fn print(mut self: Box<Self>) -> anyhow::Result<()> {
Ok(writeln!(self.writer, "{:?}", &self.content)?)
}
Expand All @@ -68,7 +68,7 @@ pub struct YamlPrinter<T, W> {
writer: W,
}

impl<T: Serialize + Debug, W: Write> Printer<T, W> for YamlPrinter<T, W> {
impl<T: Debug, W: Write> Printer<T, W> for YamlPrinter<T, W> {
fn print(self: Box<Self>) -> anyhow::Result<()> {
Ok(serde_yaml::to_writer(self.writer, &self.content)?)
}
Expand Down

0 comments on commit 3c842b0

Please sign in to comment.