serde: Fix Base64 not being Send + Sync

This commit is contained in:
Jonas Platte 2022-01-23 14:29:44 +01:00
parent b7bcecbb77
commit 2bdcf8fdfe
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -11,7 +11,8 @@ use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Base64<C = Standard, B = Vec<u8>> {
bytes: B,
_phantom_conf: PhantomData<*mut C>,
// Invariant PhantomData, Send + Sync
_phantom_conf: PhantomData<fn(C) -> C>,
}
/// Config used for the [`Base64`] type.