Skip to content

Commit

Permalink
Merge pull request rust-num#150 from withoutboats/to_writer_trait_obj…
Browse files Browse the repository at this point in the history
…ects

Allow trait objects in the to_writer function.
  • Loading branch information
dtolnay authored Sep 15, 2016
2 parents 5d3ba25 + ea988a1 commit d7e08c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions json/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ fn fmt_f64_or_null<W>(wr: &mut W, value: f64) -> Result<()>

/// Encode the specified struct into a json `[u8]` writer.
#[inline]
pub fn to_writer<W, T>(writer: &mut W, value: &T) -> Result<()>
pub fn to_writer<W: ?Sized, T>(writer: &mut W, value: &T) -> Result<()>
where W: io::Write,
T: ser::Serialize,
{
Expand All @@ -961,7 +961,7 @@ pub fn to_writer<W, T>(writer: &mut W, value: &T) -> Result<()>

/// Encode the specified struct into a json `[u8]` writer.
#[inline]
pub fn to_writer_pretty<W, T>(writer: &mut W, value: &T) -> Result<()>
pub fn to_writer_pretty<W: ?Sized, T>(writer: &mut W, value: &T) -> Result<()>
where W: io::Write,
T: ser::Serialize,
{
Expand Down

0 comments on commit d7e08c7

Please sign in to comment.