Skip to content

Commit

Permalink
API: Rename feature flag serde-1 to serde
Browse files Browse the repository at this point in the history
(Old concerns don't matter anymore, especially with renamed deps.)
  • Loading branch information
bluss committed Sep 25, 2019
1 parent 8c3dfbc commit cac792e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Expand Up @@ -37,13 +37,12 @@ harness = false
[features]
default = ["std"]
std = []
serde-1 = ["serde"]

array-sizes-33-128 = []
array-sizes-129-255 = []

[package.metadata.docs.rs]
features = ["serde-1"]
features = ["serde"]

[package.metadata.release]
no-dev-version = true
10 changes: 5 additions & 5 deletions src/array_string.rs
Expand Up @@ -14,7 +14,7 @@ use crate::array::Index;
use crate::CapacityError;
use crate::char::encode_utf8;

#[cfg(feature="serde-1")]
#[cfg(feature="serde")]
use serde::{Serialize, Deserialize, Serializer, Deserializer};

use super::MaybeUninit as MaybeUninitCopy;
Expand Down Expand Up @@ -518,8 +518,8 @@ impl<A> FromStr for ArrayString<A>
}
}

#[cfg(feature="serde-1")]
/// Requires crate feature `"serde-1"`
#[cfg(feature="serde")]
/// Requires crate feature `"serde"`
impl<A> Serialize for ArrayString<A>
where A: Array<Item=u8> + Copy
{
Expand All @@ -530,8 +530,8 @@ impl<A> Serialize for ArrayString<A>
}
}

#[cfg(feature="serde-1")]
/// Requires crate feature `"serde-1"`
#[cfg(feature="serde")]
/// Requires crate feature `"serde"`
impl<'de, A> Deserialize<'de> for ArrayString<A>
where A: Array<Item=u8> + Copy
{
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Expand Up @@ -7,9 +7,9 @@
//! - Optional, enabled by default
//! - Use libstd; disable to use `no_std` instead.
//!
//! - `serde-1`
//! - `serde`
//! - Optional
//! - Enable serialization for ArrayVec and ArrayString using serde 1.0
//! - Enable serialization for ArrayVec and ArrayString using serde 1.x
//! - `array-sizes-33-128`, `array-sizes-129-255`
//! - Optional
//! - Enable more array sizes (see [Array] for more information)
Expand All @@ -21,7 +21,7 @@
#![doc(html_root_url="https://docs.rs/arrayvec/0.4/")]
#![cfg_attr(not(feature="std"), no_std)]

#[cfg(feature="serde-1")]
#[cfg(feature="serde")]
extern crate serde;

#[cfg(not(feature="std"))]
Expand All @@ -46,7 +46,7 @@ use std::io;
mod maybe_uninit;
use crate::maybe_uninit::MaybeUninit;

#[cfg(feature="serde-1")]
#[cfg(feature="serde")]
use serde::{Serialize, Deserialize, Serializer, Deserializer};

mod array;
Expand Down Expand Up @@ -1104,8 +1104,8 @@ impl<A: Array<Item=u8>> io::Write for ArrayVec<A> {
fn flush(&mut self) -> io::Result<()> { Ok(()) }
}

#[cfg(feature="serde-1")]
/// Requires crate feature `"serde-1"`
#[cfg(feature="serde")]
/// Requires crate feature `"serde"`
impl<T: Serialize, A: Array<Item=T>> Serialize for ArrayVec<A> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer
Expand All @@ -1114,8 +1114,8 @@ impl<T: Serialize, A: Array<Item=T>> Serialize for ArrayVec<A> {
}
}

#[cfg(feature="serde-1")]
/// Requires crate feature `"serde-1"`
#[cfg(feature="serde")]
/// Requires crate feature `"serde"`
impl<'de, T: Deserialize<'de>, A: Array<Item=T>> Deserialize<'de> for ArrayVec<A> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>
Expand Down

0 comments on commit cac792e

Please sign in to comment.