Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion serac/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serac"
version = "0.4.3"
version = "0.4.4"
edition = "2024"
description = "A static, modular, and light-weight serialization framework."
license = "CC-BY-NC-SA-4.0"
Expand Down
29 changes: 29 additions & 0 deletions serac/src/encoding/vanilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,35 @@ unsafe impl<T: Size> Size for Option<T> {
const SIZE: usize = 1 + T::SIZE;
}

// unit impl (no-op)

impl SerializeIter for () {
fn serialize_iter<'a>(
&self,
_dst: impl IntoIterator<Item = &'a mut <Vanilla as Encoding>::Word>,
) -> Result<usize, error::EndOfInput>
where
<Vanilla as Encoding>::Word: 'a,
{
Ok(0)
}

fn deserialize_iter<'a>(
_src: impl IntoIterator<Item = &'a <Vanilla as Encoding>::Word>,
) -> Result<Self, error::Error>
where
<Vanilla as Encoding>::Word: 'a,
{
Ok(())
}
}

unsafe impl Size for () {
const SIZE: usize = 0;
}

unsafe impl SerializeBuf<0> for () {}

// PhantomData impl (no-op)

impl<T> SerializeIter for PhantomData<T> {
Expand Down
Loading