mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-23 07:11:04 +00:00
fix tests on stable
This commit is contained in:
@@ -70,9 +70,11 @@ use super::{
|
||||
Error,
|
||||
Serialize,
|
||||
Serializer,
|
||||
IteratorSerializer,
|
||||
};
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
use super::IteratorSerializer;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
macro_rules! impl_visit {
|
||||
|
||||
@@ -18,7 +18,9 @@ use error;
|
||||
#[cfg(all(feature = "collections", not(feature = "std")))]
|
||||
use collections::String;
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
use core::marker::PhantomData;
|
||||
#[cfg(feature = "unstable")]
|
||||
use core::cell::RefCell;
|
||||
|
||||
pub mod impls;
|
||||
@@ -418,12 +420,14 @@ pub trait Serializer {
|
||||
/// A wrapper type for iterators that implements `Serialize` for iterators whose items implement
|
||||
/// `Serialize`. Don't use multiple times. Create new versions of this with the `iterator` function
|
||||
/// every time you want to serialize an iterator.
|
||||
#[cfg(feature = "unstable")]
|
||||
pub struct IteratorSerializer<I>(RefCell<Option<I>>)
|
||||
where <I as Iterator>::Item: Serialize,
|
||||
I: Iterator;
|
||||
|
||||
/// Creates a temporary type that can be passed to any function expecting a `Serialize` and will
|
||||
/// serialize the given iterator as a sequence
|
||||
#[cfg(feature = "unstable")]
|
||||
pub fn iterator<I>(iter: I) -> IteratorSerializer<I>
|
||||
where <I as Iterator>::Item: Serialize,
|
||||
I: Iterator
|
||||
|
||||
Reference in New Issue
Block a user