Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Serialize and Deserialize #21

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ language: rust
matrix:
fast_finish: true
include:
- rust: nightly
env: FEATURES="--all-features"
- rust: nightly
env: FEATURES="--features nightly"
- rust: beta
- rust: beta
env: FEATURES="--features serde"
- rust: stable
- rust: stable
- rust: 1.3.0
env: FEATURES="--features serde"

cache:
apt: true
Expand Down
16 changes: 14 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ exclude = [

build = "build.rs"

[features]
default = []

nightly = []

[dependencies]
serde = { version = "1.0", optional = true }

[build-dependencies]
version_check = "0.1"

[features]
nightly = []
[dev-dependencies]
serde_derive = "1.0"
serde_test = "1.0"

[package.metadata.docs.rs]
features = ["serde"]
19 changes: 19 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,26 @@
//!
//! assert_eq!(a, b);
//! ```
//!
//! ## serde Support
//! Support for serialization and deserialization using
//! [serde](https://serde.rs/) is enabled with the `serde` feature flag.
//! You can usually derive or implement `Serialize`
//! and `Deserialize` directly without any issues. Refer to the `serde`
//! module for examples.
//!
//! If your usage includes borrowed data, refer to the `serde` module
//! for more details.

#[cfg(feature = "nightly")]
extern crate test;
#[cfg(feature = "serde")]
extern crate serde as serdelib;
#[cfg(all(test, feature = "serde"))]
#[macro_use]
extern crate serde_derive;
#[cfg(all(test, feature = "serde"))]
extern crate serde_test;

#[cfg(__unicase__iter_cmp)]
use std::cmp::Ordering;
Expand All @@ -55,6 +72,8 @@ use self::unicode::Unicode;

mod ascii;
mod unicode;
#[cfg(feature = "serde")]
pub mod serde;

/// Case Insensitive wrapper of strings.
#[derive(Clone, Copy)]
Expand Down
Loading