87 Commits

Author SHA1 Message Date
Jonas Platte
a89f69e4f3 Add documentation to Meta::from_attribute 2019-07-25 23:59:35 +02:00
Jonas Platte
53cf6c562d Re-run rustfmt 2019-07-25 22:42:47 +02:00
Jonas Platte
8f3b141db5 Replace string literals by identifiers in #[ruma_api] attributes 2019-07-25 22:00:24 +02:00
Jonas Platte
777e9c4c70 Stop throwing away span information when parsing metadata 2019-07-25 20:08:51 +02:00
Jonas Platte
be79a80467 Update to new ruma-api 2019-07-19 21:59:27 +02:00
Jimmy Cuadra
82a20e23da Bump dependencies. 2019-06-12 13:11:06 -07:00
Jimmy Cuadra
557ac4b485 Use the name and description fields to generate better documentation. 2019-06-12 13:06:35 -07:00
Jimmy Cuadra
6a09f1f754 Add rustfmt and clippy to CI and address clippy warnings. 2019-06-02 17:35:26 -07:00
GondwanaNuna
c3a5741f5e Make trait imports more readable (#18) 2019-05-03 18:42:25 +02:00
Jonas Platte
5f116e4e49 Remove remaining uses of quote::TokenStreamExt
fixes #4
2019-04-20 13:30:26 +02:00
Jimmy Cuadra
2e60cf8826 Remove try_from feature. 2019-04-11 18:15:32 -07:00
Jonas Platte
26842652fc Replace serde_derive by re-exports in serde 2019-02-06 20:17:38 +01:00
Jonas Platte
f761a8f837 Fix trait imports in generated code without rename
Previously, the generated code would fail to compile when the 'derive' feature
on the serde crate was enabled
2019-01-30 22:50:11 +01:00
Jonas Platte
d3322bec11 Update to Rust 2018 2019-01-13 21:41:27 +01:00
Jonas Platte
0b3dd48c3e Configure rustfmt for nested imports, re-run 'cargo fmt' 2019-01-08 20:06:19 +01:00
Jonas Platte
0a4239b678 Get rid of almost all calls to append_all 2018-12-15 21:22:07 +01:00
Jimmy Cuadra
1ac3236a9e Merge remote-tracking branch 'fest-im/master' 2018-12-03 18:26:57 -08:00
Jimmy Cuadra
d90dfdee24 Merge remote-tracking branch 'Johni0702/cloneable' 2018-12-03 18:10:52 -08:00
Jonas Platte
c9277ddc94 Upgrade dependencies 2018-11-10 22:39:29 +01:00
Jonas Herzig
20cbadd95b Make Request and Response cloneable 2018-09-12 15:27:40 +02:00
Jonas Herzig
e4ec9442d8 Make the Future returned by generated future_froms be Send 2018-09-12 13:23:33 +02:00
Jonas Herzig
e23eff151b Add convertion to/from Request/Response from/to http::Request/Response 2018-09-12 13:00:28 +02:00
Jörg Sommer
116a6f44bc Fix some hints from Rust and clippy
* the feature `proc_macro` has been stable since 1.29.0 and no longer
  requires an attribute to enable

* https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#needless_return

* https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#len_zero
2018-08-31 13:47:29 +02:00
Jörg Sommer
c91b9137fb Update dependent crates quote, syn and others
Cargo treats updates in the third position of the version number as
compatible and updates them silently. Therefore, we can drop this number
in the config.

`Tokens` was moved from *quote* to *proc_macro2* and got renamed to
`TokenStream`.
2018-08-31 13:47:27 +02:00
Jörg Sommer
8703e515a9 Replace Vec<u8> by hyper::Body
The `hyper::Request` and `Response` used in *ruma-client* require a type
parameter that implements `hyper::body::Payload`, but no implementation
for `Vec<u8>` is provided by a crate. Therefore, the best is to use
`hyper::Body` in the macros.
2018-08-31 13:46:28 +02:00
Jimmy Cuadra
1bedd5af4e Request body must always be a Vec<u8>. 2018-05-19 02:08:44 -07:00
Jimmy Cuadra
ff30a4381a Use fields stripped of serde attributes. 2018-05-19 02:08:44 -07:00
Jimmy Cuadra
621b73bd6f Add missing commas after each query field. 2018-05-19 02:08:44 -07:00
Jimmy Cuadra
1678ee2cea Ignore attributes that aren't Meta::Lists. 2018-05-19 02:08:44 -07:00
Florian Jacob
c59b43d027 Throw StatusCode error if http response is non-success
to prevent a misleading deserialization error on error responses.
2018-05-18 09:08:33 +02:00
Jimmy Cuadra
ef32a2f9c1 Convert between HeaderValue and the declared type. 2018-05-16 01:43:17 -07:00
Jimmy Cuadra
e3cf7a38a1 Remove code for building full bodies from streams. 2018-05-16 01:21:59 -07:00
Jimmy Cuadra
a27adc2f73 Use Vec<u8> for request and response bodies. Use http's API for creating requests and responses. 2018-05-16 01:11:37 -07:00
Jimmy Cuadra
c9454caff1 Update request/response header logic for new style. 2018-05-16 00:40:51 -07:00
Jimmy Cuadra
f0f4f9bd17 Detect header attributes as name/value pairs. 2018-05-15 22:57:06 -07:00
Jimmy Cuadra
a035c233be Remove remaining references to hyper and use new header style in docs. 2018-05-15 01:49:42 -07:00
Jimmy Cuadra
7b1e22eea4 Rewrite Api's ToTokens impl to avoid calls to append_all with string literals. 2018-05-15 01:32:38 -07:00
Jimmy Cuadra
5bc253b324 Rewrite request and response ToTokens to avoid calls to append_all with string literals. 2018-05-15 01:32:38 -07:00
Jimmy Cuadra
f6b6c94675 Preserve span information for fields. 2018-05-13 00:23:57 -07:00
Jimmy Cuadra
c86cdb29b3 Fix another bug and use a more useful variable name for named path segments. 2018-05-13 00:09:39 -07:00
Jimmy Cuadra
38746660b6 Use a custom parser for the raw input. 2018-05-12 23:56:23 -07:00
Jimmy Cuadra
8f6bc5af77 Fix remaining compiler errors. 2018-05-11 08:50:39 -07:00
Jimmy Cuadra
09e377d68e Extract relevant types out of the metadata's fields. 2018-05-04 20:13:34 -07:00
Jimmy Cuadra
dfaf1c7da1 Rearrange some code. 2018-05-04 19:39:48 -07:00
Jimmy Cuadra
5e9a3be5d4 Simplify code with ToTokens::into_tokens. 2018-05-04 19:31:42 -07:00
Jimmy Cuadra
2a84e038c4 Remove parse module. 2018-05-04 18:53:03 -07:00
Jimmy Cuadra
4c46df9a59 Update strip_serde_attrs, uncomment code. 2018-05-04 18:50:22 -07:00
Jimmy Cuadra
ab106f75ac ExprStruct --> Response 2018-05-04 18:46:48 -07:00
Jimmy Cuadra
a1929e38cf ExprStruct --> Request 2018-05-04 17:32:12 -07:00
Jimmy Cuadra
ba6eef9c76 Switch TryFrom back to From since proc macros must panic on errors. 2018-05-04 17:07:35 -07:00