Skip to content

Commit 0d4a703

Browse files
committed
Merge pull request #4 from yannleretaille/master
switch to postgres ^0.11, fix errors caused by that, re-add nightly to travis.yml
2 parents faf9ff0 + e90f9f1 commit 0d4a703

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sudo: required
33
rust:
44
- beta
55
- stable
6+
- nightly
67
env:
78
global:
89
- secure: GnJm2lLeA/ZN9oO4/S4VO38Fue0E+hYvRSL4I8Y2tcgTUANPUiR1vRyDNSEjoUlYfOhJOElaQw6a+UxbzXfTrtfHVg0AAbfsI3Y+jOPlyDZZ+hKIQijDCBQ0LtMSt2Ji4g+IM18LlEUE6KpSaP3v0BZsVdvd+b1EKli2G/8HQCCHBdyOmi1xNbRBV8whO6EVZ3L+xnj0e1Zen3RaVVVnAKliQQCOzcKQX7TQ+pDtc0PyuBx2S0Amf5+O2rVVLa0hGTYtf8u+fw9R1N4yMS7xSvIAT+oBaTxnXLdzAb4txeESQLA7TasuA1RBgtTQ2m0d5ESGlz648ChFIK4xOYZp/sKEM0uUXr4f/WO6d2s1uZOYrbkwN8NcHZBq2yY/78QJ4QL4wjLk9XaONSZcDhRB64weQKoLPe93vH2L2lZgmyVZh8KwaFKA9aAQvzi31lEgu3ldAdVX/cXFS7kLLYEYG7fmpSLXKSPcD8nZ9scsOL61PqwSfngsb1QZOK0p5zart7AxskpsToy4A7OHDn+LkQV6uuWk6oD3wwDCRg5qHWUqm/n/Bn8RhT+d/2zxN8D1WygqPiAp61O0dNIx9HMNl+NOBEspzPXx70H7YoyIYIMDpUumwRXytuxI3E5O5H3/IIyTYthtYnxM9VYTfwloJ9SgCyONnbOaWULhYRIWmMg=

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgis"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
authors = ["ShuYu Wang <[email protected]>"]
55
description = "An extension to rust-postgres, adds support for PostGIS."
66
homepage = "https://github.com/andelf/rust-postgis"
@@ -11,5 +11,5 @@ keywords = ["PostgreSQL", "PostGIS", "GIS", "GEO"]
1111
license = "MIT"
1212

1313
[dependencies]
14-
postgres = "^0.10"
14+
postgres = "^0.11"
1515
byteorder = "^0.4"

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::mem;
1515
use std::marker::PhantomData;
1616
use std::iter::FromIterator;
1717
use std::convert::From;
18-
use postgres::types::{Type, IsNull, ToSql, FromSql, SessionInfo};
18+
use postgres::types::{Type, IsNull, ToSql, FromSql, SessionInfo, WrongType};
1919
use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian};
2020
pub mod mars;
2121

@@ -384,7 +384,7 @@ macro_rules! impl_traits_for_point {
384384
impl<S: SRID> FromSql for $ptype<S> {
385385
accepts_geography!();
386386
fn from_sql<R: Read>(ty: &Type, raw: &mut R, _ctx: &SessionInfo) -> postgres::Result<$ptype<S>> {
387-
<$ptype<S> as ToPoint>::read_ewkb(raw).map_err(|_| postgres::error::Error::WrongType(ty.clone()))
387+
<$ptype<S> as ToPoint>::read_ewkb(raw).map_err(|_| {let err: Box<std::error::Error + Sync + Send> = format!("cannot convert {} to ToPoint", ty).into(); postgres::error::Error::Conversion(err)})
388388
}
389389
}
390390

@@ -490,7 +490,7 @@ macro_rules! define_geometry_container_type {
490490
impl<P: ToPoint + fmt::Debug> FromSql for $geotype<P> {
491491
accepts_geography!();
492492
fn from_sql<R: Read>(ty: &Type, raw: &mut R, _ctx: &SessionInfo) -> postgres::Result<$geotype<P>> {
493-
<Self as Geometry>::read_ewkb(raw).map_err(|_| postgres::error::Error::WrongType(ty.clone()))
493+
<Self as Geometry>::read_ewkb(raw).map_err(|_| {let err: Box<std::error::Error + Sync + Send> = format!("cannot convert {} to Geometry", ty).into(); postgres::error::Error::Conversion(err)})
494494
}
495495
}
496496
);
@@ -558,7 +558,7 @@ macro_rules! define_geometry_container_type {
558558
impl<P: ToPoint + fmt::Debug> FromSql for $geotype<P> {
559559
accepts_geography!();
560560
fn from_sql<R: Read>(ty: &Type, raw: &mut R, _ctx: &SessionInfo) -> postgres::Result<$geotype<P>> {
561-
<Self as Geometry>::read_ewkb(raw).map_err(|_| postgres::error::Error::WrongType(ty.clone()))
561+
<Self as Geometry>::read_ewkb(raw).map_err(|_| {let err: Box<std::error::Error + Sync + Send> = format!("cannot convert {} to Geometry", ty).into(); postgres::error::Error::Conversion(err)})
562562
}
563563
}
564564
)
@@ -749,7 +749,7 @@ impl<P: ToPoint + fmt::Debug> ToSql for GeometryCollection<P> {
749749
impl<P: ToPoint + fmt::Debug> FromSql for GeometryCollection<P> {
750750
accepts_geography!();
751751
fn from_sql<R: Read>(ty: &Type, raw: &mut R, _ctx: &SessionInfo) -> postgres::Result<GeometryCollection<P>> {
752-
<Self as Geometry>::read_ewkb(raw).map_err(|_| postgres::error::Error::WrongType(ty.clone()))
752+
<Self as Geometry>::read_ewkb(raw).map_err(|_| {let err: Box<std::error::Error + Sync + Send> = format!("cannot convert {} to Geometry", ty).into(); postgres::error::Error::Conversion(err)})
753753
}
754754
}
755755

0 commit comments

Comments
 (0)