Skip to content

Commit

Permalink
Use std::fmt::Write instead of std::io::Write.
Browse files Browse the repository at this point in the history
  • Loading branch information
ximon18 committed Nov 21, 2024
1 parent 0a79594 commit d390d15
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/sign/records.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::fmt::Debug;
use std::hash::Hash;
use std::string::String;
use std::vec::Vec;
use std::{fmt, io, slice};
use std::{fmt, slice};

use octseq::builder::{EmptyBuilder, FromBuilder, OctetsBuilder, Truncate};
use octseq::{FreezeBuilder, OctetsFrom, OctetsInto};
Expand Down Expand Up @@ -677,20 +677,20 @@ impl<N, D> SortedRecords<N, D> {
}
}

pub fn write<W>(&self, target: &mut W) -> Result<(), io::Error>
pub fn write<W>(&self, target: &mut W) -> Result<(), fmt::Error>
where
N: fmt::Display,
D: RecordData + fmt::Display,
W: io::Write,
W: fmt::Write,
{
for record in self.records.iter().filter(|r| r.rtype() == Rtype::SOA)
{
writeln!(target, "{record}")?;
write!(target, "{record}")?;
}

for record in self.records.iter().filter(|r| r.rtype() != Rtype::SOA)
{
writeln!(target, "{record}")?;
write!(target, "{record}")?;
}

Ok(())
Expand All @@ -700,12 +700,12 @@ impl<N, D> SortedRecords<N, D> {
&self,
target: &mut W,
comment_cb: F,
) -> Result<(), io::Error>
) -> Result<(), fmt::Error>
where
N: fmt::Display,
D: RecordData + fmt::Display,
W: io::Write,
F: Fn(&Record<N, D>, &mut W) -> std::io::Result<()>,
W: fmt::Write,
F: Fn(&Record<N, D>, &mut W) -> Result<(), fmt::Error>,
{
for record in self.records.iter().filter(|r| r.rtype() == Rtype::SOA)
{
Expand Down

0 comments on commit d390d15

Please sign in to comment.