From 91cfb003d930d46f8bd9904214d619b8804d06bf Mon Sep 17 00:00:00 2001 From: Thomas Bahn Date: Tue, 23 Dec 2014 16:45:32 +0100 Subject: [PATCH] Fix: String::from_utf8 changed function signature Following a rust std change. --- src/json/ser.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/json/ser.rs b/src/json/ser.rs index 65414929..ac07b677 100644 --- a/src/json/ser.rs +++ b/src/json/ser.rs @@ -2,6 +2,7 @@ use std::f32; use std::f64; use std::num::{Float, FPNaN, FPInfinite}; use std::io::{IoError, IoResult}; +use std::str::Utf8Error; use ser::Serialize; use ser; @@ -599,7 +600,7 @@ pub fn to_vec< #[inline] pub fn to_string< T: Serialize>, IoError> ->(value: &T) -> Result> { +>(value: &T) -> Result, Utf8Error)> { let buf = to_vec(value); String::from_utf8(buf) } @@ -628,7 +629,7 @@ pub fn to_pretty_vec< /// Encode the specified struct into a json `String` buffer. pub fn to_pretty_string< T: Serialize>, IoError> ->(value: &T) -> Result> { +>(value: &T) -> Result, Utf8Error)> { let buf = to_pretty_vec(value); String::from_utf8(buf) }