Skip to content

Commit

Permalink
Rename serde to serde2, which is a workaround for a major cargo funct…
Browse files Browse the repository at this point in the history
…ionality oversight and bug rust-lang/cargo#5730
  • Loading branch information
bendst committed Nov 7, 2018
1 parent a51f831 commit 6be4193
Show file tree
Hide file tree
Showing 106 changed files with 431 additions and 431 deletions.
8 changes: 4 additions & 4 deletions serde/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "serde"
name = "serde2"
version = "1.0.80" # remember to update html_root_url
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
license = "MIT/Apache-2.0"
Expand All @@ -18,10 +18,10 @@ travis-ci = { repository = "serde-rs/serde" }
appveyor = { repository = "serde-rs/serde" }

[dependencies]
serde_derive = { version = "1.0", optional = true, path = "../serde_derive" }
serde2_derive = { version = "1.0", optional = true, path = "../serde_derive" }

[dev-dependencies]
serde_derive = { version = "1.0", path = "../serde_derive" }
serde2_derive = { version = "1.0", path = "../serde_derive" }


### FEATURES #################################################################
Expand Down Expand Up @@ -53,7 +53,7 @@ default = ["std"]
# #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
# struct ...
#
derive = ["serde_derive"]
derive = ["serde2_derive"]

# Provide impls for common standard library types like Vec<T> and HashMap<K, V>.
# Requires a dependency on the Rust standard library.
Expand Down
2 changes: 1 addition & 1 deletion serde/src/de/from_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ impl_from_primitive_for_uint!(u64);
impl_from_primitive_for_float!(f32);
impl_from_primitive_for_float!(f64);

serde_if_integer128! {
serde2_if_integer128! {
impl FromPrimitive for i128 {
#[inline]
fn from_i8(n: i8) -> Option<Self> {
Expand Down
4 changes: 2 additions & 2 deletions serde/src/de/ignored_any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};

/// An efficient way of discarding data from a deserializer.
///
/// Think of this like `serde_json::Value` in that it can be deserialized from
/// Think of this like `serde2_json::Value` in that it can be deserialized from
/// any type, except that it does not store any information about the data that
/// gets deserialized.
///
/// ```rust
/// use std::fmt;
/// use std::marker::PhantomData;
///
/// use serde::de::{
/// use serde2::de::{
/// self, Deserialize, DeserializeSeed, Deserializer, IgnoredAny, SeqAccess, Visitor,
/// };
///
Expand Down
36 changes: 18 additions & 18 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl_deserialize_num!(usize, deserialize_u64, integer);
impl_deserialize_num!(f32, deserialize_f32, integer, float);
impl_deserialize_num!(f64, deserialize_f64, integer, float);

serde_if_integer128! {
serde2_if_integer128! {
impl<'de> Deserialize<'de> for i128 {
#[inline]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
Expand Down Expand Up @@ -1597,10 +1597,10 @@ impl<'de> Deserialize<'de> for PathBuf {

////////////////////////////////////////////////////////////////////////////////

// If this were outside of the serde crate, it would just use:
// If this were outside of the serde2 crate, it would just use:
//
// #[derive(Deserialize)]
// #[serde(variant_identifier)]
// #[serde2(variant_identifier)]
#[cfg(all(feature = "std", any(unix, windows)))]
variant_identifier!{
OsStringKind (Unix; b"Unix"; 0, Windows; b"Windows"; 1)
Expand Down Expand Up @@ -1685,7 +1685,7 @@ forwarded_impl! {
/// deduplicate `Arc` references to the same data. Every deserialized `Arc`
/// will end up with a strong count of 1.
///
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
(T), Arc<T>, Arc::new
}

Expand All @@ -1701,7 +1701,7 @@ forwarded_impl! {
/// deduplicate `Rc` references to the same data. Every deserialized `Rc`
/// will end up with a strong count of 1.
///
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
(T), Rc<T>, Rc::new
}

Expand All @@ -1725,7 +1725,7 @@ where
/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting
/// `Weak<T>` has a reference count of 0 and cannot be upgraded.
///
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
impl<'de, T: ?Sized> Deserialize<'de> for RcWeak<T>
where
Expand All @@ -1743,7 +1743,7 @@ where
/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting
/// `Weak<T>` has a reference count of 0 and cannot be upgraded.
///
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))]
impl<'de, T: ?Sized> Deserialize<'de> for ArcWeak<T>
where
Expand Down Expand Up @@ -1797,7 +1797,7 @@ box_forwarded_impl! {
/// deduplicate `Rc` references to the same data. Every deserialized `Rc`
/// will end up with a strong count of 1.
///
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
Rc
}

Expand All @@ -1813,7 +1813,7 @@ box_forwarded_impl! {
/// deduplicate `Arc` references to the same data. Every deserialized `Arc`
/// will end up with a strong count of 1.
///
/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc
/// [`"rc"`]: https://serde2.rs/feature-flags.html#-features-rc
Arc
}

Expand Down Expand Up @@ -1844,7 +1844,7 @@ forwarded_impl!((T), RwLock<T>, RwLock::new);
// This is a cleaned-up version of the impl generated by:
//
// #[derive(Deserialize)]
// #[serde(deny_unknown_fields)]
// #[serde2(deny_unknown_fields)]
// struct Duration {
// secs: u64,
// nanos: u32,
Expand All @@ -1855,10 +1855,10 @@ impl<'de> Deserialize<'de> for Duration {
where
D: Deserializer<'de>,
{
// If this were outside of the serde crate, it would just use:
// If this were outside of the serde2 crate, it would just use:
//
// #[derive(Deserialize)]
// #[serde(field_identifier, rename_all = "lowercase")]
// #[serde2(field_identifier, rename_all = "lowercase")]
enum Field {
Secs,
Nanos,
Expand Down Expand Up @@ -2110,7 +2110,7 @@ impl<'de> Deserialize<'de> for SystemTime {
// Similar to:
//
// #[derive(Deserialize)]
// #[serde(deny_unknown_fields)]
// #[serde2(deny_unknown_fields)]
// struct Range {
// start: u64,
// end: u32,
Expand Down Expand Up @@ -2163,10 +2163,10 @@ mod range {

pub const FIELDS: &'static [&'static str] = &["start", "end"];

// If this were outside of the serde crate, it would just use:
// If this were outside of the serde2 crate, it would just use:
//
// #[derive(Deserialize)]
// #[serde(field_identifier, rename_all = "lowercase")]
// #[serde2(field_identifier, rename_all = "lowercase")]
enum Field {
Start,
End,
Expand Down Expand Up @@ -2318,7 +2318,7 @@ nonzero_integers! {

// Currently 128-bit integers do not work on Emscripten targets so we need an
// additional `#[cfg]`
serde_if_integer128! {
serde2_if_integer128! {
nonzero_integers! {
NonZeroU128,
}
Expand All @@ -2335,10 +2335,10 @@ where
where
D: Deserializer<'de>,
{
// If this were outside of the serde crate, it would just use:
// If this were outside of the serde2 crate, it would just use:
//
// #[derive(Deserialize)]
// #[serde(variant_identifier)]
// #[serde2(variant_identifier)]
enum Field {
Ok,
Err,
Expand Down
Loading

0 comments on commit 6be4193

Please sign in to comment.