Skip to content

Commit 1ab8100

Browse files
committed
Fix build
1 parent 599e5db commit 1ab8100

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/types/rustc_serialize.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
extern crate rustc_serialize;
22

33
use self::rustc_serialize::json;
4-
use std::io::{Cursor, Write};
4+
use std::io::{Read, Write};
55
use std::error::Error;
66

77
use types::{FromSql, ToSql, IsNull, Type, SessionInfo};
88

99
impl FromSql for json::Json {
1010
fn from_sql(ty: &Type,
11-
raw: &[u8],
11+
mut raw: &[u8],
1212
_: &SessionInfo)
1313
-> Result<json::Json, Box<Error + Sync + Send>> {
14-
let mut raw = Cursor::new(raw);
1514
if let Type::Jsonb = *ty {
1615
let mut b = [0; 1];
1716
try!(raw.read_exact(&mut b));

src/types/serde_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extern crate serde_json;
22

33
use self::serde_json::Value;
44
use std::error::Error;
5-
use std::io::Write;
5+
use std::io::{Read, Write};
66

77
use types::{FromSql, ToSql, IsNull, Type, SessionInfo};
88

0 commit comments

Comments
 (0)