mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-21 21:21:04 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb059b97c0 | |||
| b7188f7022 | |||
| a64fe99d1b | |||
| c716c4e261 | |||
| 3d2e3beafe | |||
| 1917e54a6e | |||
| 898b346d48 | |||
| e90adb20ef | |||
| a52e7f5554 | |||
| 7afb8b52ae | |||
| cb4694387e |
@@ -26,6 +26,8 @@ script:
|
|||||||
- (cd serde_tests && travis-cargo --only nightly test -- --features nightly-testing)
|
- (cd serde_tests && travis-cargo --only nightly test -- --features nightly-testing)
|
||||||
- (cd serde_macros && travis-cargo --only nightly test -- --features nightly-testing)
|
- (cd serde_macros && travis-cargo --only nightly test -- --features nightly-testing)
|
||||||
- (cd serde_macros && travis-cargo --only nightly bench -- --features nightly-testing)
|
- (cd serde_macros && travis-cargo --only nightly bench -- --features nightly-testing)
|
||||||
|
- (cd examples/serde-syntex-example && travis-cargo --skip 1.5.0 run)
|
||||||
|
- (cd examples/serde-syntex-example && travis-cargo --only nightly run -- --features nightly --no-default-features)
|
||||||
- (cd serde && travis-cargo --only stable doc)
|
- (cd serde && travis-cargo --only stable doc)
|
||||||
- (cd serde_codegen && travis-cargo --only stable doc)
|
- (cd serde_codegen && travis-cargo --only stable doc)
|
||||||
- (cd serde_macros && travis-cargo --only nightly doc)
|
- (cd serde_macros && travis-cargo --only nightly doc)
|
||||||
|
|||||||
@@ -142,10 +142,7 @@ pub fn main() {
|
|||||||
let src = Path::new("src/main.rs.in");
|
let src = Path::new("src/main.rs.in");
|
||||||
let dst = Path::new(&out_dir).join("main.rs");
|
let dst = Path::new(&out_dir).join("main.rs");
|
||||||
|
|
||||||
let mut registry = syntex::Registry::new();
|
serde_codegen::expand(&src, &dst).unwrap();
|
||||||
|
|
||||||
serde_codegen::register(&mut registry);
|
|
||||||
registry.expand("", &src, &dst).unwrap();
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -203,10 +200,7 @@ mod inner {
|
|||||||
let src = Path::new("src/main.rs.in");
|
let src = Path::new("src/main.rs.in");
|
||||||
let dst = Path::new(&out_dir).join("main.rs");
|
let dst = Path::new(&out_dir).join("main.rs");
|
||||||
|
|
||||||
let mut registry = syntex::Registry::new();
|
serde_codegen::expand(&src, &dst).unwrap();
|
||||||
|
|
||||||
serde_codegen::register(&mut registry);
|
|
||||||
registry.expand("", &src, &dst).unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
paths = [
|
||||||
|
"../serde",
|
||||||
|
"../serde_codegen",
|
||||||
|
"../serde_macros",
|
||||||
|
]
|
||||||
@@ -9,10 +9,10 @@ default = ["serde_codegen"]
|
|||||||
nightly = ["serde_macros"]
|
nightly = ["serde_macros"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
serde_codegen = { version = "^0.7.8", optional = true }
|
serde_codegen = { version = "^0.7.9", optional = true }
|
||||||
syntex = "^0.33.0"
|
syntex = "^0.33.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = "^0.7.8"
|
serde = "^0.7.9"
|
||||||
serde_json = "^0.7.0"
|
serde_json = "^0.7.0"
|
||||||
serde_macros = { version = "^0.7.8", optional = true }
|
serde_macros = { version = "^0.7.9", optional = true }
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ This example demonstrates how to use Serde with Syntex. On stable or nightly
|
|||||||
with Syntex, it can be built with:
|
with Syntex, it can be built with:
|
||||||
|
|
||||||
```
|
```
|
||||||
% multirust run stable cargo run
|
% rustup run stable cargo run
|
||||||
Running `target/debug/serde-syntex-example`
|
Running `target/debug/serde-syntex-example`
|
||||||
{"x":1,"y":2}
|
{"x":1,"y":2}
|
||||||
Point { x: 1, y: 2 }
|
Point { x: 1, y: 2 }
|
||||||
|
|
||||||
% multirust run nightly cargo run
|
% rustup run nightly cargo run
|
||||||
Running `target/debug/serde-syntex-example`
|
Running `target/debug/serde-syntex-example`
|
||||||
{"x":1,"y":2}
|
{"x":1,"y":2}
|
||||||
Point { x: 1, y: 2 }
|
Point { x: 1, y: 2 }
|
||||||
@@ -16,5 +16,5 @@ Point { x: 1, y: 2 }
|
|||||||
On nightly, it can use a plugin with:
|
On nightly, it can use a plugin with:
|
||||||
|
|
||||||
```
|
```
|
||||||
% multirust run nightly cargo run --features nightly --no-default-features
|
% rustup run nightly cargo run --features nightly --no-default-features
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ mod inner {
|
|||||||
let src = Path::new("src/main.rs.in");
|
let src = Path::new("src/main.rs.in");
|
||||||
let dst = Path::new(&out_dir).join("main.rs");
|
let dst = Path::new(&out_dir).join("main.rs");
|
||||||
|
|
||||||
let mut registry = syntex::Registry::new();
|
serde_codegen::expand(&src, &dst).unwrap();
|
||||||
|
|
||||||
serde_codegen::register(&mut registry);
|
|
||||||
registry.expand("", &src, &dst).unwrap();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#![cfg_attr(nightly, feature(custom_derive, plugin))]
|
#![cfg_attr(feature = "serde_macros", feature(custom_derive, plugin))]
|
||||||
#![cfg_attr(nightly, plugin(serde_macros))]
|
#![cfg_attr(feature = "serde_macros", plugin(serde_macros))]
|
||||||
|
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
extern crate serde_json;
|
extern crate serde_json;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "0.7.8"
|
version = "0.7.9"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_codegen"
|
name = "serde_codegen"
|
||||||
version = "0.7.8"
|
version = "0.7.9"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros to auto-generate implementations for the serde framework"
|
description = "Macros to auto-generate implementations for the serde framework"
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ extern crate syntax;
|
|||||||
#[cfg(not(feature = "with-syntex"))]
|
#[cfg(not(feature = "with-syntex"))]
|
||||||
extern crate rustc_plugin;
|
extern crate rustc_plugin;
|
||||||
|
|
||||||
|
#[cfg(feature = "with-syntex")]
|
||||||
|
use std::io;
|
||||||
|
#[cfg(feature = "with-syntex")]
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
#[cfg(not(feature = "with-syntex"))]
|
#[cfg(not(feature = "with-syntex"))]
|
||||||
use syntax::feature_gate::AttributeType;
|
use syntax::feature_gate::AttributeType;
|
||||||
|
|
||||||
@@ -31,6 +36,16 @@ include!(concat!(env!("OUT_DIR"), "/lib.rs"));
|
|||||||
#[cfg(not(feature = "with-syntex"))]
|
#[cfg(not(feature = "with-syntex"))]
|
||||||
include!("lib.rs.in");
|
include!("lib.rs.in");
|
||||||
|
|
||||||
|
#[cfg(feature = "with-syntex")]
|
||||||
|
pub fn expand<S, D>(src: S, dst: D) -> io::Result<()>
|
||||||
|
where S: AsRef<Path>,
|
||||||
|
D: AsRef<Path>,
|
||||||
|
{
|
||||||
|
let mut registry = syntex::Registry::new();
|
||||||
|
register(&mut registry);
|
||||||
|
registry.expand("", src.as_ref(), dst.as_ref())
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "with-syntex")]
|
#[cfg(feature = "with-syntex")]
|
||||||
pub fn register(reg: &mut syntex::Registry) {
|
pub fn register(reg: &mut syntex::Registry) {
|
||||||
use syntax::{ast, fold};
|
use syntax::{ast, fold};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_macros"
|
name = "serde_macros"
|
||||||
version = "0.7.8"
|
version = "0.7.9"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "Macros to auto-generate implementations for the serde framework"
|
description = "Macros to auto-generate implementations for the serde framework"
|
||||||
@@ -18,12 +18,12 @@ nightly-testing = ["clippy", "serde/nightly-testing", "serde_codegen/nightly-tes
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clippy = { version = "^0.*", optional = true }
|
clippy = { version = "^0.*", optional = true }
|
||||||
serde_codegen = { version = "^0.7.8", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
serde_codegen = { version = "^0.7.9", path = "../serde_codegen", default-features = false, features = ["nightly"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
compiletest_rs = "^0.1.1"
|
compiletest_rs = "^0.1.1"
|
||||||
rustc-serialize = "^0.3.16"
|
rustc-serialize = "^0.3.16"
|
||||||
serde = { version = "^0.7.8", path = "../serde" }
|
serde = { version = "^0.7.9", path = "../serde" }
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "test"
|
name = "test"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_tests"
|
name = "serde_tests"
|
||||||
version = "0.7.8"
|
version = "0.7.9"
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>"]
|
||||||
license = "MIT/Apache-2.0"
|
license = "MIT/Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
|
|||||||
Reference in New Issue
Block a user