Skip to content

Commit 631ad07

Browse files
committed
Merge branch 'release-v0.6.1' into release
2 parents d2e78c6 + 20ecfee commit 631ad07

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "postgres_array"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
authors = ["Steven Fackler <sfackler@gmail.com>"]
55
license = "MIT"
66
description = "Array support for rust-postgres"
77
repository = "https://github.com/sfackler/rust-postgres-array"
8-
documentation = "https://sfackler.github.io/rust-postgres-array/doc/v0.6.0/postgres_array"
8+
documentation = "https://sfackler.github.io/rust-postgres-array/doc/v0.6.1/postgres_array"
99

1010
[dependencies]
1111
postgres = "0.11"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# rust-postgres-array
22
[![Build Status](https://travis-ci.org/sfackler/rust-postgres-array.svg?branch=master)](https://travis-ci.org/sfackler/rust-postgres-array)
33

4-
[Documentation](https://sfackler.github.io/rust-postgres-array/doc/v0.6.0/postgres_array)
4+
[Documentation](https://sfackler.github.io/rust-postgres-array/doc/v0.6.1/postgres_array)
55

66
Support for PostgreSQL arrays in [rust-postgres](https://github.com/sfackler/rust-postgres).

src/impls.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ use postgres::types::{Type, Kind, ToSql, FromSql, Oid, IsNull, SessionInfo};
88

99
use {Array, Dimension};
1010

11-
impl<T> FromSql for Array<Option<T>> where T: FromSql {
11+
impl<T> FromSql for Array<T> where T: FromSql {
1212
fn from_sql<R: Read>(ty: &Type, raw: &mut R, info: &SessionInfo)
13-
-> postgres::Result<Array<Option<T>>> {
13+
-> postgres::Result<Array<T>> {
1414
let element_type = match ty.kind() {
1515
&Kind::Array(ref ty) => ty,
1616
_ => panic!("unexpected type {:?}", ty),
@@ -37,10 +37,10 @@ impl<T> FromSql for Array<Option<T>> where T: FromSql {
3737
for _ in 0..nele {
3838
let len = try!(raw.read_i32::<BigEndian>());
3939
if len < 0 {
40-
elements.push(None);
40+
elements.push(try!(FromSql::from_sql_null(&element_type, info)));
4141
} else {
4242
let mut limit = raw.take(len as u64);
43-
elements.push(Some(try!(FromSql::from_sql(&element_type, &mut limit, info))));
43+
elements.push(try!(FromSql::from_sql(&element_type, &mut limit, info)));
4444
if limit.limit() != 0 {
4545
let err: Box<error::Error+Sync+Send> =
4646
"from_sql call did not consume all data".into();
@@ -226,6 +226,6 @@ mod test {
226226
fn test_empty_array() {
227227
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();
228228
let stmt = conn.prepare("SELECT '{}'::INT4[]").unwrap();
229-
stmt.query(&[]).unwrap().iter().next().unwrap().get::<_, Array<Option<i32>>>(0);
229+
stmt.query(&[]).unwrap().iter().next().unwrap().get::<_, Array<i32>>(0);
230230
}
231231
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Multi-dimensional arrays with per-dimension specifiable lower bounds
2-
#![doc(html_root_url="https://sfackler.github.io/rust-postgres-array/doc/v0.6.0")]
2+
#![doc(html_root_url="https://sfackler.github.io/rust-postgres-array/doc/v0.6.1")]
33

44
#[macro_use(to_sql_checked)]
55
extern crate postgres;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy