Skip to content

Commit d7e08c7

Browse files
authored
Merge pull request rust-num#150 from withoutboats/to_writer_trait_objects
Allow trait objects in the to_writer function.
2 parents 5d3ba25 + ea988a1 commit d7e08c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json/src/ser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ fn fmt_f64_or_null<W>(wr: &mut W, value: f64) -> Result<()>
950950

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

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

0 commit comments

Comments
 (0)