From 7931f3e4f942b7aa4028dd1878e55a4754f20641 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 22 Jan 2022 05:00:31 -0800 Subject: [PATCH] Fix imports on features +alloc +raw_value -std Closes #850. --- .github/workflows/ci.yml | 1 + src/raw.rs | 3 +++ src/value/de.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61999373f..b7e82ab8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,7 @@ jobs: - run: cargo check --features raw_value - run: cargo check --features unbounded_depth - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc + - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,raw_value - run: cargo check --features preserve_order if: matrix.rust != '1.45.0' && matrix.rust != '1.40.0' && matrix.rust != '1.38.0' && matrix.rust != '1.36.0' - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,preserve_order diff --git a/src/raw.rs b/src/raw.rs index f171535d7..fcb067bc4 100644 --- a/src/raw.rs +++ b/src/raw.rs @@ -1,4 +1,7 @@ use crate::error::Error; +use alloc::borrow::ToOwned; +use alloc::boxed::Box; +use alloc::string::String; use core::fmt::{self, Debug, Display}; use core::mem; use serde::de::value::BorrowedStrDeserializer; diff --git a/src/value/de.rs b/src/value/de.rs index 347dbee96..75e49df55 100644 --- a/src/value/de.rs +++ b/src/value/de.rs @@ -4,6 +4,8 @@ use crate::number::Number; use crate::value::Value; use alloc::borrow::{Cow, ToOwned}; use alloc::string::String; +#[cfg(feature = "raw_value")] +use alloc::string::ToString; use alloc::vec::{self, Vec}; use core::fmt; use core::slice;