Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Commit bc07a89

Browse files
committed
Update to postgres 0.14
1 parent b9d10e7 commit bc07a89

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ syn = "0.11"
1717
quote = "0.3"
1818

1919
[dev-dependencies]
20-
postgres = "0.13"
20+
postgres = "0.14"

src/fromsql.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ pub fn expand_derive_fromsql(input: &MacroInput) -> Result<String, String> {
3636
let out = quote! {
3737
impl ::postgres::types::FromSql for #ident {
3838
fn from_sql(_type: &::postgres::types::Type,
39-
buf: &[u8],
40-
_info: &::postgres::types::SessionInfo)
39+
buf: &[u8])
4140
-> ::std::result::Result<#ident,
4241
::std::boxed::Box<::std::error::Error +
4342
::std::marker::Sync +
@@ -82,7 +81,7 @@ fn domain_accepts_body(field: &syn::Field) -> Tokens {
8281
fn domain_body(ident: &Ident, field: &syn::Field) -> Tokens {
8382
let ty = &field.ty;
8483
quote! {
85-
<#ty as ::postgres::types::FromSql>::from_sql(_type, buf, _info).map(#ident)
84+
<#ty as ::postgres::types::FromSql>::from_sql(_type, buf).map(#ident)
8685
}
8786
}
8887

@@ -103,8 +102,7 @@ fn composite_body(ident: &Ident, fields: &[Field]) -> Tokens {
103102
}
104103

105104
fn read_value<T>(type_: &::postgres::types::Type,
106-
buf: &mut &[u8],
107-
info: &::postgres::types::SessionInfo)
105+
buf: &mut &[u8])
108106
-> ::std::result::Result<T,
109107
::std::boxed::Box<::std::error::Error +
110108
::std::marker::Sync +
@@ -123,7 +121,7 @@ fn composite_body(ident: &Ident, fields: &[Field]) -> Tokens {
123121
*buf = tail;
124122
::std::option::Option::Some(&head[..])
125123
};
126-
::postgres::types::FromSql::from_sql_nullable(type_, value, info)
124+
::postgres::types::FromSql::from_sql_nullable(type_, value)
127125
}
128126

129127
let fields = match *_type.kind() {
@@ -153,7 +151,7 @@ fn composite_body(ident: &Ident, fields: &[Field]) -> Tokens {
153151
#(
154152
#field_names => {
155153
#temp_vars = ::std::option::Option::Some(
156-
try!(read_value(field.type_(), &mut buf, _info)));
154+
try!(read_value(field.type_(), &mut buf)));
157155
}
158156
)*
159157
_ => unreachable!(),

src/tosql.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ pub fn expand_derive_tosql(input: &MacroInput) -> Result<String, String> {
3737
impl ::postgres::types::ToSql for #ident {
3838
fn to_sql(&self,
3939
_type: &::postgres::types::Type,
40-
buf: &mut ::std::vec::Vec<u8>,
41-
_info: &::postgres::types::SessionInfo)
40+
buf: &mut ::std::vec::Vec<u8>)
4241
-> ::std::result::Result<::postgres::types::IsNull,
4342
::std::boxed::Box<::std::error::Error +
4443
::std::marker::Sync +
@@ -98,7 +97,7 @@ fn domain_body() -> Tokens {
9897
_ => unreachable!(),
9998
};
10099

101-
::postgres::types::ToSql::to_sql(&self.0, type_, buf, _info)
100+
::postgres::types::ToSql::to_sql(&self.0, type_, buf)
102101
}
103102
}
104103

@@ -131,8 +130,7 @@ fn composite_body(fields: &[Field]) -> Tokens {
131130
#field_names => {
132131
::postgres::types::ToSql::to_sql(&self.#field_idents,
133132
field.type_(),
134-
buf,
135-
_info)
133+
buf)
136134
}
137135
)*
138136
_ => unreachable!(),

0 commit comments

Comments
 (0)