Skip to content
This repository was archived by the owner on Oct 10, 2019. It is now read-only.

Commit ff2f1c3

Browse files
committed
Merge branch 'release-v0.1.2' into release
2 parents 1ef6c47 + 3b52cf4 commit ff2f1c3

File tree

5 files changed

+18
-24
lines changed

5 files changed

+18
-24
lines changed

postgres-derive-codegen/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgres-derive-codegen"
3-
version = "0.1.0"
3+
version = "0.1.2"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Deriving codegen support for Postgres enum, domain, and composite types"
@@ -16,8 +16,8 @@ nightly = []
1616
with-syntex = ["syntex", "syntex_syntax"]
1717

1818
[build-dependencies]
19-
syntex = { version = "0.29", optional = true }
19+
syntex = { version = "0.31", optional = true }
2020

2121
[dependencies]
22-
syntex = { version = "0.29", optional = true }
23-
syntex_syntax = { version = "0.29", optional = true }
22+
syntex = { version = "0.31", optional = true }
23+
syntex_syntax = { version = "0.31", optional = true }

postgres-derive-codegen/src/fromsql.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use syntax::ext::base::{Annotatable, ExtCtxt};
22
use syntax::codemap::Span;
3-
use syntax::ast::{MetaItem, ItemKind, Block, VariantData, Ident, Ty, StructFieldKind};
3+
use syntax::ast::{MetaItem, ItemKind, Block, VariantData, Ident, Ty};
44
use syntax::attr::AttrMetaMethods;
55
use syntax::ptr::P;
66
use syntax::ext::build::AstBuilder;
@@ -39,20 +39,17 @@ pub fn expand(ctx: &mut ExtCtxt,
3939
"#[derive(FromSql)] can only be applied to one field tuple structs");
4040
return;
4141
}
42-
let inner = &fields[0].node.ty;
42+
let inner = &fields[0].ty;
4343

4444
(domain_accepts_body(ctx, inner), domain_from_sql_body(ctx, item.ident, inner))
4545
}
4646
ItemKind::Struct(VariantData::Struct(ref fields, _), _) => {
4747
let fields = fields.iter()
4848
.map(|field| {
49-
let ident = match field.node.kind {
50-
StructFieldKind::NamedField(ident, _) => ident,
51-
_ => unreachable!(),
52-
};
53-
let overrides = overrides::get_overrides(ctx, &field.node.attrs);
49+
let ident = field.ident.unwrap();
50+
let overrides = overrides::get_overrides(ctx, &field.attrs);
5451
let name = overrides.name.unwrap_or_else(|| ident.name.as_str());
55-
(name, ident, &*field.node.ty)
52+
(name, ident, &*field.ty)
5653
})
5754
.collect::<Vec<_>>();
5855
let trait_ = quote_path!(ctx, ::postgres::types::FromSql);

postgres-derive-codegen/src/tosql.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use syntax::ext::base::{Annotatable, ExtCtxt};
22
use syntax::codemap::Span;
3-
use syntax::ast::{MetaItem, ItemKind, Block, VariantData, Ident, Ty, StructFieldKind};
3+
use syntax::ast::{MetaItem, ItemKind, Block, VariantData, Ident, Ty};
44
use syntax::attr::AttrMetaMethods;
55
use syntax::ptr::P;
66
use syntax::ext::build::AstBuilder;
@@ -39,20 +39,17 @@ pub fn expand(ctx: &mut ExtCtxt,
3939
"#[derive(ToSql)] can only be applied to one field tuple structs");
4040
return;
4141
}
42-
let inner = &fields[0].node.ty;
42+
let inner = &fields[0].ty;
4343

4444
(domain_accepts_body(ctx, name, inner), domain_to_sql_body(ctx))
4545
}
4646
ItemKind::Struct(VariantData::Struct(ref fields, _), _) => {
4747
let fields = fields.iter()
4848
.map(|field| {
49-
let ident = match field.node.kind {
50-
StructFieldKind::NamedField(ident, _) => ident,
51-
_ => unreachable!(),
52-
};
53-
let overrides = overrides::get_overrides(ctx, &field.node.attrs);
49+
let ident = field.ident.unwrap();
50+
let overrides = overrides::get_overrides(ctx, &field.attrs);
5451
let name = overrides.name.unwrap_or_else(|| ident.name.as_str());
55-
(name, ident, &*field.node.ty)
52+
(name, ident, &*field.ty)
5653
})
5754
.collect::<Vec<_>>();
5855
let trait_ = quote_path!(ctx, ::postgres::types::ToSql);

postgres-derive-codegen/test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build = "build.rs"
66

77
[build-dependencies]
88
postgres-derive-codegen = { path = ".." }
9-
syntex = "0.29"
9+
syntex = "0.31"
1010

1111
[dependencies]
1212
postgres = "0.11.1"

postgres-derive-macros/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "postgres-derive-macros"
3-
version = "0.1.0"
3+
version = "0.1.2"
44
authors = ["Steven Fackler <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Deriving macro support for Postgres enum, domain, and composite types"
@@ -13,8 +13,8 @@ plugin = true
1313
test = false
1414

1515
[dependencies]
16-
postgres-derive-codegen = { version = "0.1", path = "../postgres-derive-codegen", default-features = false, features = ["nightly"] }
16+
postgres-derive-codegen = { version = "0.1.2", path = "../postgres-derive-codegen", default-features = false, features = ["nightly"] }
1717

1818
[dev-dependencies]
1919
postgres = "0.11.3"
20-
compiletest_rs = "0.0.11"
20+
compiletest_rs = "0.1"

0 commit comments

Comments
 (0)