Content-Length: 534293 | pFad | http://github.com/psqlpy-python/rust-postgres-array/commit/d2e78c636dd64eef0bacf55f36e2551e52ac9f5c

62 Merge branch 'release-v0.6.0' into release · psqlpy-python/rust-postgres-array@d2e78c6 · GitHub
Skip to content

Commit d2e78c6

Browse files
committed
Merge branch 'release-v0.6.0' into release
2 parents 1e55b21 + b681b0d commit d2e78c6

File tree

5 files changed

+34
-35
lines changed

5 files changed

+34
-35
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
22
name = "postgres_array"
3-
version = "0.5.2"
3+
version = "0.6.0"
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.5.2/postgres_array"
8+
documentation = "https://sfackler.github.io/rust-postgres-array/doc/v0.6.0/postgres_array"
99

1010
[dependencies]
11-
postgres = ">= 0.9, < 0.11"
11+
postgres = "0.11"
1212
byteorder = ">= 0.3, < 0.5"
1313

1414
[dev-dependencies]

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.5.2/postgres_array)
4+
[Documentation](https://sfackler.github.io/rust-postgres-array/doc/v0.6.0/postgres_array)
55

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

src/array.rs

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -192,34 +192,33 @@ tuple_impl!(a: isize, b: isize, c: isize, d: isize, e: isize, f: isize, g: isize
192192
tuple_impl!(a: isize, b: isize, c: isize, d: isize, e: isize, f: isize, g: isize, h: isize);
193193
tuple_impl!(a: isize, b: isize, c: isize, d: isize, e: isize, f: isize, g: isize, h: isize, i: isize);
194194

195+
//github.com/ Indexes into the `Array`, retrieving a reference to the contained
196+
//github.com/ value.
197+
//github.com/
198+
//github.com/ Since `Array`s can be multi-dimensional, the `Index` trait is
199+
//github.com/ implemented for a variety of index types. In the most generic case, a
200+
//github.com/ `&[isize]` can be used. In addition, a bare `isize` as well as tuples
201+
//github.com/ of up to 10 `isize` values may be used for convenience.
202+
//github.com/
203+
//github.com/ # Panics
204+
//github.com/
205+
//github.com/ Panics if the index does not correspond to an in-bounds element of the
206+
//github.com/ `Array`.
207+
//github.com/
208+
//github.com/ # Examples
209+
//github.com/
210+
//github.com/ ```rust
211+
//github.com/ # use postgres_array::Array;
212+
//github.com/ let mut array = Array::from_vec(vec![0i32, 1, 2, 3], 0);
213+
//github.com/ assert_eq!(2, array[2]);
214+
//github.com/
215+
//github.com/ array.wrap(0);
216+
//github.com/ array.push(Array::from_vec(vec![4, 5, 6, 7], 0));
217+
//github.com/
218+
//github.com/ assert_eq!(6, array[(1, 2)]);
219+
//github.com/ ```
195220
impl<T, I: ArrayIndex> Index<I> for Array<T> {
196221
type Output = T;
197-
198-
//github.com/ Indexes into the `Array`, retrieving a reference to the contained
199-
//github.com/ value.
200-
//github.com/
201-
//github.com/ Since `Array`s can be multi-dimensional, the `Index` trait is
202-
//github.com/ implemented for a variety of index types. In the most generic case, a
203-
//github.com/ `&[isize]` can be used. In addition, a bare `isize` as well as tuples
204-
//github.com/ of up to 10 `isize` values may be used for convenience.
205-
//github.com/
206-
//github.com/ # Panics
207-
//github.com/
208-
//github.com/ Panics if the index does not correspond to an in-bounds element of the
209-
//github.com/ `Array`.
210-
//github.com/
211-
//github.com/ # Examples
212-
//github.com/
213-
//github.com/ ```rust
214-
//github.com/ # use postgres_array::Array;
215-
//github.com/ let mut array = Array::from_vec(vec![0i32, 1, 2, 3], 0);
216-
//github.com/ assert_eq!(2, array[2]);
217-
//github.com/
218-
//github.com/ array.wrap(0);
219-
//github.com/ array.push(Array::from_vec(vec![4, 5, 6, 7], 0));
220-
//github.com/
221-
//github.com/ assert_eq!(6, array[(1, 2)]);
222-
//github.com/ ```
223222
fn index(&self, idx: I) -> &T {
224223
let idx = idx.index(self);
225224
&self.data[idx]

src/impls.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<T> FromSql for Array<Option<T>> where T: FromSql {
2121
let _element_type: Oid = try!(raw.read_u32::<BigEndian>());
2222

2323
let mut dim_info = Vec::with_capacity(ndim);
24-
for _ in (0..ndim) {
24+
for _ in 0..ndim {
2525
dim_info.push(Dimension {
2626
len: try!(raw.read_u32::<BigEndian>()) as usize,
2727
lower_bound: try!(raw.read_i32::<BigEndian>()) as isize,
@@ -34,7 +34,7 @@ impl<T> FromSql for Array<Option<T>> where T: FromSql {
3434
};
3535

3636
let mut elements = Vec::with_capacity(nele);
37-
for _ in (0..nele) {
37+
for _ in 0..nele {
3838
let len = try!(raw.read_i32::<BigEndian>());
3939
if len < 0 {
4040
elements.push(None);
@@ -128,7 +128,7 @@ mod test {
128128
use Array;
129129

130130
fn test_type<T: PartialEq+FromSql+ToSql, S: fmt::Display>(sql_type: &str, checks: &[(T, S)]) {
131-
let conn = Connection::connect("postgres://postgres@localhost", &SslMode::None).unwrap();
131+
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();
132132
for &(ref val, ref repr) in checks.iter() {
133133
let stmt = conn.prepare(&format!("SELECT {}::{}", *repr, sql_type)).unwrap();
134134
let result = stmt.query(&[]).unwrap().iter().next().unwrap().get(0);
@@ -224,7 +224,7 @@ mod test {
224224

225225
#[test]
226226
fn test_empty_array() {
227-
let conn = Connection::connect("postgres://postgres@localhost", &SslMode::None).unwrap();
227+
let conn = Connection::connect("postgres://postgres@localhost", SslMode::None).unwrap();
228228
let stmt = conn.prepare("SELECT '{}'::INT4[]").unwrap();
229229
stmt.query(&[]).unwrap().iter().next().unwrap().get::<_, Array<Option<i32>>>(0);
230230
}

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.5.2")]
2+
#![doc(html_root_url="https://sfackler.github.io/rust-postgres-array/doc/v0.6.0")]
33

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

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/psqlpy-python/rust-postgres-array/commit/d2e78c636dd64eef0bacf55f36e2551e52ac9f5c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy