Skip to content

Commit

Permalink
Apply 'cargo fix --edition'
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 31, 2023
1 parent 3eec111 commit ab90fbc
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 82 deletions.
4 changes: 2 additions & 2 deletions serde/src/de/format.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use lib::fmt::{self, Write};
use lib::str;
use crate::lib::fmt::{self, Write};
use crate::lib::str;

pub(super) struct Buf<'a> {
bytes: &'a mut [u8],
Expand Down
4 changes: 2 additions & 2 deletions serde/src/de/ignored_any.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use lib::*;
use crate::lib::*;

use de::{
use crate::de::{
Deserialize, Deserializer, EnumAccess, Error, MapAccess, SeqAccess, VariantAccess, Visitor,
};

Expand Down
32 changes: 16 additions & 16 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use lib::*;
use crate::lib::*;

use de::{
use crate::de::{
Deserialize, Deserializer, EnumAccess, Error, MapAccess, SeqAccess, Unexpected, VariantAccess,
Visitor,
};

use seed::InPlaceSeed;
use crate::seed::InPlaceSeed;

#[cfg(any(feature = "std", feature = "alloc"))]
use __private::size_hint;
use crate::__private::size_hint;

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

Expand Down Expand Up @@ -1555,7 +1555,7 @@ impl<'de> Deserialize<'de> for net::IpAddr {
if deserializer.is_human_readable() {
deserializer.deserialize_str(FromStrVisitor::new("IP address"))
} else {
use lib::net::IpAddr;
use crate::lib::net::IpAddr;
deserialize_enum! {
IpAddr IpAddrKind (V4; b"V4"; 0, V6; b"V6"; 1)
"`V4` or `V6`",
Expand Down Expand Up @@ -1598,7 +1598,7 @@ impl<'de> Deserialize<'de> for net::SocketAddr {
if deserializer.is_human_readable() {
deserializer.deserialize_str(FromStrVisitor::new("socket address"))
} else {
use lib::net::SocketAddr;
use crate::lib::net::SocketAddr;
deserialize_enum! {
SocketAddr SocketAddrKind (V4; b"V4"; 0, V6; b"V6"; 1)
"`V4` or `V6`",
Expand Down Expand Up @@ -1968,7 +1968,7 @@ impl<'de> Deserialize<'de> for Duration {
b"secs" => Ok(Field::Secs),
b"nanos" => Ok(Field::Nanos),
_ => {
let value = ::__private::from_utf8_lossy(value);
let value = crate::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&*value, FIELDS))
}
}
Expand Down Expand Up @@ -2259,9 +2259,9 @@ where
}

mod range {
use lib::*;
use crate::lib::*;

use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
use crate::de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};

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

Expand Down Expand Up @@ -2307,7 +2307,7 @@ mod range {
b"start" => Ok(Field::Start),
b"end" => Ok(Field::End),
_ => {
let value = ::__private::from_utf8_lossy(value);
let value = crate::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&*value, FIELDS))
}
}
Expand Down Expand Up @@ -2417,9 +2417,9 @@ where
}

mod range_from {
use lib::*;
use crate::lib::*;

use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
use crate::de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};

pub const FIELDS: &[&str] = &["end"];

Expand Down Expand Up @@ -2462,7 +2462,7 @@ mod range_from {
match value {
b"end" => Ok(Field::End),
_ => {
let value = ::__private::from_utf8_lossy(value);
let value = crate::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&*value, FIELDS))
}
}
Expand Down Expand Up @@ -2555,9 +2555,9 @@ where
}

mod range_to {
use lib::*;
use crate::lib::*;

use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
use crate::de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};

pub const FIELDS: &[&str] = &["start"];

Expand Down Expand Up @@ -2600,7 +2600,7 @@ mod range_to {
match value {
b"start" => Ok(Field::Start),
_ => {
let value = ::__private::from_utf8_lossy(value);
let value = crate::__private::from_utf8_lossy(value);
Err(Error::unknown_field(&*value, FIELDS))
}
}
Expand Down
14 changes: 7 additions & 7 deletions serde/src/de/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
//! [derive section of the manual]: https://serde.rs/derive.html
//! [data formats]: https://serde.rs/#data-formats

use lib::*;
use crate::lib::*;

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

Expand All @@ -126,15 +126,15 @@ mod utf8;

pub use self::ignored_any::IgnoredAny;

#[cfg(not(any(feature = "std", feature = "unstable")))]
#[doc(no_inline)]
pub use crate::std_error::Error as StdError;
#[cfg(all(feature = "unstable", not(feature = "std")))]
#[doc(no_inline)]
pub use core::error::Error as StdError;
#[cfg(feature = "std")]
#[doc(no_inline)]
pub use std::error::Error as StdError;
#[cfg(not(any(feature = "std", feature = "unstable")))]
#[doc(no_inline)]
pub use std_error::Error as StdError;

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

Expand Down Expand Up @@ -1229,11 +1229,11 @@ pub trait Deserializer<'de>: Sized {
#[doc(hidden)]
fn __deserialize_content<V>(
self,
_: ::actually_private::T,
_: crate::actually_private::T,
visitor: V,
) -> Result<::private::de::Content<'de>, Self::Error>
) -> Result<crate::private::de::Content<'de>, Self::Error>
where
V: Visitor<'de, Value = ::private::de::Content<'de>>,
V: Visitor<'de, Value = crate::private::de::Content<'de>>,
{
self.deserialize_any(visitor)
}
Expand Down
2 changes: 1 addition & 1 deletion serde/src/de/seed.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use de::{Deserialize, DeserializeSeed, Deserializer};
use crate::de::{Deserialize, DeserializeSeed, Deserializer};

/// A DeserializeSeed helper for implementing deserialize_in_place Visitors.
///
Expand Down
2 changes: 1 addition & 1 deletion serde/src/de/utf8.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use lib::*;
use crate::lib::*;

const TAG_CONT: u8 = 0b1000_0000;
const TAG_TWO_B: u8 = 0b1100_0000;
Expand Down
14 changes: 8 additions & 6 deletions serde/src/de/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
//! }
//! ```

use lib::*;
use crate::lib::*;

use self::private::{First, Second};
use __private::size_hint;
use de::{self, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use ser;
use crate::__private::size_hint;
use crate::de::{self, Deserializer, Expected, IntoDeserializer, SeqAccess, Visitor};
use crate::ser;

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

Expand Down Expand Up @@ -1546,9 +1546,11 @@ where
////////////////////////////////////////////////////////////////////////////////

mod private {
use lib::*;
use crate::lib::*;

use de::{self, DeserializeSeed, Deserializer, MapAccess, Unexpected, VariantAccess, Visitor};
use crate::de::{
self, DeserializeSeed, Deserializer, MapAccess, Unexpected, VariantAccess, Visitor,
};

pub struct UnitOnly<E> {
marker: PhantomData<E>,
Expand Down
4 changes: 2 additions & 2 deletions serde/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ pub mod de;
pub mod ser;

#[doc(inline)]
pub use de::{Deserialize, Deserializer};
pub use crate::de::{Deserialize, Deserializer};
#[doc(inline)]
pub use ser::{Serialize, Serializer};
pub use crate::ser::{Serialize, Serializer};

// Used by generated code and doc tests. Not public API.
#[doc(hidden)]
Expand Down
20 changes: 10 additions & 10 deletions serde/src/private/de.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use lib::*;
use crate::lib::*;

use de::value::{BorrowedBytesDeserializer, BytesDeserializer};
use de::{Deserialize, Deserializer, Error, IntoDeserializer, Visitor};
use crate::de::value::{BorrowedBytesDeserializer, BytesDeserializer};
use crate::de::{Deserialize, Deserializer, Error, IntoDeserializer, Visitor};

#[cfg(any(feature = "std", feature = "alloc"))]
use de::{DeserializeSeed, MapAccess, Unexpected};
use crate::de::{DeserializeSeed, MapAccess, Unexpected};

#[cfg(any(feature = "std", feature = "alloc"))]
pub use self::content::{
Expand All @@ -13,7 +13,7 @@ pub use self::content::{
TagOrContentField, TagOrContentFieldVisitor, TaggedContentVisitor, UntaggedUnitVisitor,
};

pub use seed::InPlaceSeed;
pub use crate::seed::InPlaceSeed;

/// If the missing field is of type `Option<T>` then treat is as `None`,
/// otherwise it is an error.
Expand Down Expand Up @@ -203,12 +203,12 @@ mod content {
// This issue is tracking making some of this stuff public:
// https://github.com/serde-rs/serde/issues/741

use lib::*;
use crate::lib::*;

use __private::size_hint;
use actually_private;
use de::value::{MapDeserializer, SeqDeserializer};
use de::{
use crate::__private::size_hint;
use crate::actually_private;
use crate::de::value::{MapDeserializer, SeqDeserializer};
use crate::de::{
self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected, IgnoredAny,
MapAccess, SeqAccess, Unexpected, Visitor,
};
Expand Down
4 changes: 2 additions & 2 deletions serde/src/private/doc.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Used only by Serde doc tests. Not public API.

use lib::*;
use crate::lib::*;

use ser;
use crate::ser;

#[doc(hidden)]
#[derive(Debug)]
Expand Down
22 changes: 11 additions & 11 deletions serde/src/private/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ pub mod size_hint;
// FIXME: #[cfg(doctest)] once https://github.com/rust-lang/rust/issues/67295 is fixed.
pub mod doc;

pub use lib::clone::Clone;
pub use lib::convert::{From, Into};
pub use lib::default::Default;
pub use lib::fmt::{self, Formatter};
pub use lib::marker::PhantomData;
pub use lib::option::Option::{self, None, Some};
pub use lib::ptr;
pub use lib::result::Result::{self, Err, Ok};
pub use crate::lib::clone::Clone;
pub use crate::lib::convert::{From, Into};
pub use crate::lib::default::Default;
pub use crate::lib::fmt::{self, Formatter};
pub use crate::lib::marker::PhantomData;
pub use crate::lib::option::Option::{self, None, Some};
pub use crate::lib::ptr;
pub use crate::lib::result::Result::{self, Err, Ok};

pub use self::string::from_utf8_lossy;

#[cfg(any(feature = "alloc", feature = "std"))]
pub use lib::{ToString, Vec};
pub use crate::lib::{ToString, Vec};

#[cfg(not(no_core_try_from))]
pub use lib::convert::TryFrom;
pub use crate::lib::convert::TryFrom;

mod string {
use lib::*;
use crate::lib::*;

#[cfg(any(feature = "std", feature = "alloc"))]
pub fn from_utf8_lossy(bytes: &[u8]) -> Cow<str> {
Expand Down
20 changes: 10 additions & 10 deletions serde/src/private/ser.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use lib::*;
use crate::lib::*;

use ser::{self, Impossible, Serialize, SerializeMap, SerializeStruct, Serializer};
use crate::ser::{self, Impossible, Serialize, SerializeMap, SerializeStruct, Serializer};

#[cfg(any(feature = "std", feature = "alloc"))]
use self::content::{
Expand Down Expand Up @@ -337,9 +337,9 @@ where

#[cfg(any(feature = "std", feature = "alloc"))]
mod content {
use lib::*;
use crate::lib::*;

use ser::{self, Serialize, Serializer};
use crate::ser::{self, Serialize, Serializer};

pub struct SerializeTupleVariantAsMapValue<M> {
map: M,
Expand Down Expand Up @@ -499,47 +499,47 @@ mod content {
}
Content::Seq(ref elements) => elements.serialize(serializer),
Content::Tuple(ref elements) => {
use ser::SerializeTuple;
use crate::ser::SerializeTuple;
let mut tuple = tri!(serializer.serialize_tuple(elements.len()));
for e in elements {
tri!(tuple.serialize_element(e));
}
tuple.end()
}
Content::TupleStruct(n, ref fields) => {
use ser::SerializeTupleStruct;
use crate::ser::SerializeTupleStruct;
let mut ts = tri!(serializer.serialize_tuple_struct(n, fields.len()));
for f in fields {
tri!(ts.serialize_field(f));
}
ts.end()
}
Content::TupleVariant(n, i, v, ref fields) => {
use ser::SerializeTupleVariant;
use crate::ser::SerializeTupleVariant;
let mut tv = tri!(serializer.serialize_tuple_variant(n, i, v, fields.len()));
for f in fields {
tri!(tv.serialize_field(f));
}
tv.end()
}
Content::Map(ref entries) => {
use ser::SerializeMap;
use crate::ser::SerializeMap;
let mut map = tri!(serializer.serialize_map(Some(entries.len())));
for (k, v) in entries {
tri!(map.serialize_entry(k, v));
}
map.end()
}
Content::Struct(n, ref fields) => {
use ser::SerializeStruct;
use crate::ser::SerializeStruct;
let mut s = tri!(serializer.serialize_struct(n, fields.len()));
for &(k, ref v) in fields {
tri!(s.serialize_field(k, v));
}
s.end()
}
Content::StructVariant(n, i, v, ref fields) => {
use ser::SerializeStructVariant;
use crate::ser::SerializeStructVariant;
let mut sv = tri!(serializer.serialize_struct_variant(n, i, v, fields.len()));
for &(k, ref v) in fields {
tri!(sv.serialize_field(k, v));
Expand Down
2 changes: 1 addition & 1 deletion serde/src/private/size_hint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use lib::*;
use crate::lib::*;

pub fn from_bounds<I>(iter: &I) -> Option<usize>
where
Expand Down
Loading

0 comments on commit ab90fbc

Please sign in to comment.