diff --git a/derive/src/parse.rs b/derive/src/parse.rs index f7ed622..6fb606c 100644 --- a/derive/src/parse.rs +++ b/derive/src/parse.rs @@ -4,15 +4,15 @@ //! https://docs.rs/syn/0.15.44/syn/enum.Type.html //! https://ziglang.org/documentation/0.5.0/#toc-typeInfo -use alloc::collections::BTreeSet; -use core::iter::Peekable; -use core::num::IntErrorKind; - -use alloc::borrow::ToOwned; -use alloc::boxed::Box; -use alloc::string::{String, ToString}; -use alloc::vec::Vec; -use alloc::{format, vec}; +use ::alloc::collections::BTreeSet; +use ::core::iter::Peekable; +use ::core::num::IntErrorKind; + +use ::alloc::borrow::ToOwned; +use ::alloc::boxed::Box; +use ::alloc::string::{String, ToString}; +use ::alloc::vec::Vec; +use ::alloc::{format, vec}; use proc_macro::{Delimiter, Group, TokenStream, TokenTree}; diff --git a/derive/src/serde_bin.rs b/derive/src/serde_bin.rs index f2b1a8e..f67aa9c 100644 --- a/derive/src/serde_bin.rs +++ b/derive/src/serde_bin.rs @@ -1,5 +1,5 @@ -use alloc::format; -use alloc::string::String; +use ::alloc::format; +use ::alloc::string::String; use crate::{ parse::{Category, Enum, Struct, Type}, diff --git a/derive/src/serde_json.rs b/derive/src/serde_json.rs index 2ff394e..7fda5dc 100644 --- a/derive/src/serde_json.rs +++ b/derive/src/serde_json.rs @@ -1,6 +1,6 @@ -use alloc::format; -use alloc::string::{String, ToString}; -use alloc::{vec, vec::Vec}; +use ::alloc::format; +use ::alloc::string::{String, ToString}; +use ::alloc::{vec, vec::Vec}; use crate::parse::{Category, Type}; use crate::shared::{enum_bounds_strings, struct_bounds_strings}; diff --git a/derive/src/serde_ron.rs b/derive/src/serde_ron.rs index 29c4050..f8296f6 100644 --- a/derive/src/serde_ron.rs +++ b/derive/src/serde_ron.rs @@ -1,6 +1,6 @@ -use alloc::format; -use alloc::string::{String, ToString}; -use alloc::vec::Vec; +use ::alloc::format; +use ::alloc::string::{String, ToString}; +use ::alloc::vec::Vec; use crate::{ parse::{Attribute, Category, Enum, Field, Struct, Type}, diff --git a/derive/src/shared.rs b/derive/src/shared.rs index a8bfc6c..0054515 100644 --- a/derive/src/shared.rs +++ b/derive/src/shared.rs @@ -1,8 +1,8 @@ #![cfg(any(feature = "json", feature = "ron", feature = "binary"))] use crate::parse::{Enum, Struct}; -use alloc::string::String; -use alloc::{format, string::ToString, vec::Vec}; +use ::alloc::string::String; +use ::alloc::{format, string::ToString, vec::Vec}; macro_rules! l { ($target:ident, $line:expr) => { diff --git a/src/serde_bin.rs b/src/serde_bin.rs index 335c217..3abbe7b 100644 --- a/src/serde_bin.rs +++ b/src/serde_bin.rs @@ -1,11 +1,11 @@ -use core::error::Error; -use core::{convert::TryInto, time::Duration}; +use ::core::error::Error; +use ::core::{convert::TryInto, time::Duration}; -use alloc::borrow::ToOwned; -use alloc::boxed::Box; -use alloc::collections::{BTreeMap, BTreeSet, LinkedList}; -use alloc::string::String; -use alloc::vec::Vec; +use ::alloc::borrow::ToOwned; +use ::alloc::boxed::Box; +use ::alloc::collections::{BTreeMap, BTreeSet, LinkedList}; +use ::alloc::string::String; +use ::alloc::vec::Vec; /// A trait for objects that can be serialized to binary. pub trait SerBin { @@ -454,7 +454,7 @@ where T: DeBin, { fn de_bin(o: &mut usize, d: &[u8]) -> Result { - use core::mem::MaybeUninit; + use ::core::mem::MaybeUninit; // waiting for uninit_array(or for array::try_from_fn) stabilization // https://github.com/rust-lang/rust/issues/96097 diff --git a/src/serde_json.rs b/src/serde_json.rs index 4b078d9..713e666 100644 --- a/src/serde_json.rs +++ b/src/serde_json.rs @@ -1,11 +1,11 @@ -use core::str::Chars; -use core::{error::Error, fmt::Write, time::Duration}; +use ::core::str::Chars; +use ::core::{error::Error, fmt::Write, time::Duration}; -use alloc::boxed::Box; -use alloc::collections::{BTreeMap, BTreeSet, LinkedList}; -use alloc::format; -use alloc::string::{String, ToString}; -use alloc::vec::Vec; +use ::alloc::boxed::Box; +use ::alloc::collections::{BTreeMap, BTreeSet, LinkedList}; +use ::alloc::format; +use ::alloc::string::{String, ToString}; +use ::alloc::vec::Vec; /// The internal state of a JSON serialization. #[non_exhaustive] @@ -1052,7 +1052,7 @@ where T: DeJson, { fn de_json(o: &mut DeJsonState, d: &mut Chars) -> Result { - use core::mem::MaybeUninit; + use ::core::mem::MaybeUninit; // waiting for uninit_array(or for array::try_from_fn) stabilization // https://github.com/rust-lang/rust/issues/96097 diff --git a/src/serde_ron.rs b/src/serde_ron.rs index e9e44ec..23b82c6 100644 --- a/src/serde_ron.rs +++ b/src/serde_ron.rs @@ -1,11 +1,11 @@ -use core::str::Chars; -use core::{error::Error, fmt::Write, time::Duration}; +use ::core::str::Chars; +use ::core::{error::Error, fmt::Write, time::Duration}; -use alloc::boxed::Box; -use alloc::collections::{BTreeMap, BTreeSet, LinkedList}; -use alloc::format; -use alloc::string::{String, ToString}; -use alloc::vec::Vec; +use ::alloc::boxed::Box; +use ::alloc::collections::{BTreeMap, BTreeSet, LinkedList}; +use ::alloc::format; +use ::alloc::string::{String, ToString}; +use ::alloc::vec::Vec; /// The internal state of a RON serialization. pub struct SerRonState { @@ -1043,7 +1043,7 @@ where T: DeRon, { fn de_ron(o: &mut DeRonState, d: &mut Chars) -> Result { - use core::mem::MaybeUninit; + use ::core::mem::MaybeUninit; // waiting for uninit_array(or for array::try_from_fn) stabilization // https://github.com/rust-lang/rust/issues/96097 diff --git a/src/toml.rs b/src/toml.rs index 41d44eb..2da1909 100644 --- a/src/toml.rs +++ b/src/toml.rs @@ -1,9 +1,9 @@ -use core::error::Error; -use core::str::Chars; +use ::core::error::Error; +use ::core::str::Chars; -use alloc::format; -use alloc::string::{String, ToString}; -use alloc::{collections::BTreeMap, vec, vec::Vec}; +use ::alloc::format; +use ::alloc::string::{String, ToString}; +use ::alloc::{collections::BTreeMap, vec, vec::Vec}; /// Pattern matching any valid unquoted key character as u32. /// ABNF line: https://github.com/toml-lang/toml/blob/2431aa308a7bc97eeb50673748606e23a6e0f201/toml.abnf#L55 diff --git a/tests/bin.rs b/tests/bin.rs index a6ca33d..678827c 100644 --- a/tests/bin.rs +++ b/tests/bin.rs @@ -4,7 +4,7 @@ extern crate alloc; use std::{array, sync::atomic::AtomicBool}; -use alloc::collections::{BTreeMap, BTreeSet, LinkedList}; +use ::alloc::collections::{BTreeMap, BTreeSet, LinkedList}; use nanoserde::{DeBin, SerBin}; diff --git a/tests/ser_de.rs b/tests/ser_de.rs index bb097a9..d156b7b 100644 --- a/tests/ser_de.rs +++ b/tests/ser_de.rs @@ -9,7 +9,7 @@ use nanoserde::{DeJson, SerJson}; #[cfg(feature = "ron")] use nanoserde::{DeRon, SerRon}; -use alloc::collections::BTreeMap; +use ::alloc::collections::BTreeMap; #[derive(Default, PartialEq, Debug)] struct Test2 { diff --git a/tests/toml.rs b/tests/toml.rs index b6c3428..93c3c22 100644 --- a/tests/toml.rs +++ b/tests/toml.rs @@ -2,7 +2,7 @@ extern crate alloc; -use alloc::collections::BTreeMap; +use ::alloc::collections::BTreeMap; use nanoserde::Toml; use nanoserde::TomlParser;