From b11fee749133ca7a5a08e0ecdf947fffed531cb5 Mon Sep 17 00:00:00 2001 From: martinohmann Date: Tue, 9 Apr 2024 08:47:31 +0200 Subject: [PATCH] chore(clippy): address new pedantic lints in nightly --- crates/hcl-primitives/src/error.rs | 1 + crates/hcl-primitives/src/ident.rs | 1 + crates/hcl-primitives/src/internal_string.rs | 2 ++ crates/hcl-rs/src/expr/de.rs | 2 +- crates/hcl-rs/src/expr/ser/mod.rs | 3 +-- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/hcl-primitives/src/error.rs b/crates/hcl-primitives/src/error.rs index 289646c0..b9d239bf 100644 --- a/crates/hcl-primitives/src/error.rs +++ b/crates/hcl-primitives/src/error.rs @@ -1,3 +1,4 @@ +#[cfg(not(feature = "std"))] use alloc::string::{String, ToString}; use core::fmt; diff --git a/crates/hcl-primitives/src/ident.rs b/crates/hcl-primitives/src/ident.rs index 3c7ba087..fe5fbbef 100644 --- a/crates/hcl-primitives/src/ident.rs +++ b/crates/hcl-primitives/src/ident.rs @@ -3,6 +3,7 @@ use crate::{Error, InternalString}; use alloc::borrow::{Borrow, Cow}; use alloc::format; +#[cfg(not(feature = "std"))] use alloc::string::String; use core::fmt; use core::ops; diff --git a/crates/hcl-primitives/src/internal_string.rs b/crates/hcl-primitives/src/internal_string.rs index 30e6a05c..257bb4c2 100644 --- a/crates/hcl-primitives/src/internal_string.rs +++ b/crates/hcl-primitives/src/internal_string.rs @@ -1,7 +1,9 @@ //! Provides the `InternalString` type and associated functionality. use alloc::borrow::{Borrow, Cow}; +#[cfg(not(feature = "std"))] use alloc::boxed::Box; +#[cfg(not(feature = "std"))] use alloc::string::String; use core::fmt; use core::ops::Deref; diff --git a/crates/hcl-rs/src/expr/de.rs b/crates/hcl-rs/src/expr/de.rs index abb71dd1..1309009c 100644 --- a/crates/hcl-rs/src/expr/de.rs +++ b/crates/hcl-rs/src/expr/de.rs @@ -2,7 +2,7 @@ use super::*; use crate::de::{EnumAccess, FromStrVisitor, OptionDeserializer, VariantName}; -use crate::{Error, Identifier, Result}; +use crate::Error; use serde::de::value::{MapAccessDeserializer, StrDeserializer, StringDeserializer}; use serde::de::{self, Expected, IntoDeserializer, Unexpected, VariantAccess}; use serde::{forward_to_deserialize_any, Deserializer}; diff --git a/crates/hcl-rs/src/expr/ser/mod.rs b/crates/hcl-rs/src/expr/ser/mod.rs index dfc7e984..2cc5a6c3 100644 --- a/crates/hcl-rs/src/expr/ser/mod.rs +++ b/crates/hcl-rs/src/expr/ser/mod.rs @@ -5,9 +5,8 @@ mod tests; use super::*; use crate::ser::{in_internal_serialization, InternalHandles, SerializeInternalHandleStruct}; -use crate::{format, Error, Identifier, Number, Result}; +use crate::Error; use serde::ser::{self, Impossible, SerializeMap}; -use std::fmt; const EXPR_HANDLE_MARKER: &str = "\x00$hcl::ExprHandle";