diff --git a/Cargo.toml b/Cargo.toml index ed1be43..5fa0f65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "postgres_array" -version = "0.10.0" +version = "0.11.1" authors = ["Steven Fackler "] edition = "2018" license = "MIT" @@ -8,10 +8,10 @@ description = "Array support for rust-postgres" repository = "https://github.com/sfackler/rust-postgres-array" [dependencies] -bytes = "0.5" +bytes = "1.0" fallible-iterator = "0.2" -postgres-types = "0.1" -postgres-protocol = "0.5" +postgres-types = "0.2" +postgres-protocol = "0.6" [dev-dependencies] -postgres = "0.17" +postgres = "0.19" diff --git a/circle.yml b/circle.yml index 290a005..8e1b563 100644 --- a/circle.yml +++ b/circle.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: rust:1.40.0 + - image: rust:1.64.0 - image: postgres:12 environment: POSTGRES_PASSWORD: password diff --git a/src/array.rs b/src/array.rs index 3c030aa..9886d8d 100644 --- a/src/array.rs +++ b/src/array.rs @@ -39,6 +39,10 @@ where I: Iterator, T: 'a + fmt::Display, { + if dims.len() == 0 { + return write!(fmt, "{{}}"); + } + if depth == dims.len() { return write!(fmt, "{}", data.next().unwrap()); } diff --git a/src/lib.rs b/src/lib.rs index a326a53..21240da 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -146,5 +146,8 @@ mod tests { a.push(Array::from_vec(vec![4, 5, 6], 3)); a.wrap(1); assert_eq!("[1:1][-2:-1][3:5]={{{1,2,3},{4,5,6}}}", &format!("{}", a)); + + let a: Array = Array::from_parts(vec![], vec![]); + assert_eq!("{}", &format!("{}", a)); } } 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