Skip to content

Updates postgres dependency to 0.14 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "postgres_array"
version = "0.7.1"
version = "0.8.0"
authors = ["Steven Fackler <sfackler@gmail.com>"]
license = "MIT"
description = "Array support for rust-postgres"
repository = "https://github.com/sfackler/rust-postgres-array"
documentation = "https://sfackler.github.io/rust-postgres-array/doc/v0.7.1/postgres_array"
documentation = "https://sfackler.github.io/rust-postgres-array/doc/v0.8.0/postgres_array"

[dependencies]
fallible-iterator = "0.1"
postgres = ">= 0.12, < 0.14"
postgres-protocol = "0.1"
postgres = "0.14"
postgres-protocol = "0.3"
10 changes: 5 additions & 5 deletions src/impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fallible_iterator::FallibleIterator;
use postgres::types::{Type, Kind, ToSql, FromSql, IsNull, SessionInfo};
use postgres::types::{Type, Kind, ToSql, FromSql, IsNull};
use postgres_protocol::types;
use postgres_protocol;
use std::error::Error;
Expand All @@ -9,7 +9,7 @@ use {Array, Dimension};
impl<T> FromSql for Array<T>
where T: FromSql
{
fn from_sql(ty: &Type, raw: &[u8], info: &SessionInfo) -> Result<Array<T>, Box<Error + Sync + Send>> {
fn from_sql(ty: &Type, raw: &[u8]) -> Result<Array<T>, Box<Error + Sync + Send>> {
let element_type = match *ty.kind() {
Kind::Array(ref ty) => ty,
_ => unreachable!(),
Expand All @@ -24,7 +24,7 @@ impl<T> FromSql for Array<T>
.collect());

let elements = try!(array.values()
.and_then(|v| FromSql::from_sql_nullable(element_type, v, info))
.and_then(|v| FromSql::from_sql_nullable(element_type, v))
.collect());

Ok(Array::from_parts(elements, dimensions))
Expand All @@ -41,7 +41,7 @@ impl<T> FromSql for Array<T>
impl<T> ToSql for Array<T>
where T: ToSql
{
fn to_sql(&self, ty: &Type, w: &mut Vec<u8>, info: &SessionInfo) -> Result<IsNull, Box<Error + Sync + Send>> {
fn to_sql(&self, ty: &Type, w: &mut Vec<u8>) -> Result<IsNull, Box<Error + Sync + Send>> {
let element_type = match ty.kind() {
&Kind::Array(ref ty) => ty,
_ => unreachable!(),
Expand All @@ -62,7 +62,7 @@ impl<T> ToSql for Array<T>
element_type.oid(),
elements,
|v, w| {
match v.to_sql(element_type, w, info) {
match v.to_sql(element_type, w) {
Ok(IsNull::Yes) => Ok(postgres_protocol::IsNull::Yes),
Ok(IsNull::No) => Ok(postgres_protocol::IsNull::No),
Err(e) => Err(e),
Expand Down