Skip to content

Commit

Permalink
Refactor serializer
Browse files Browse the repository at this point in the history
Replace rmp_serde::Serializer with a simpler implementation derived
from it.

Signed-off-by: Emanuele Giaquinta <[email protected]>
  • Loading branch information
exg committed Nov 26, 2024
1 parent 2d55c1e commit 7746bc6
Show file tree
Hide file tree
Showing 4 changed files with 488 additions and 19 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ itoa = { version = "1", default-features = false }
once_cell = { version = "1", default-features = false, features = ["race"] }
pyo3 = { version = "^0.22.6", default-features = false, features = ["extension-module"] }
rmp = { version = "^0.8.14", default-features = false, features = ["std"] }
rmp-serde = { version = "1", default-features = false }
serde = { version = "1", default-features = false }
serde_bytes = { version = "0.11.15", default-features = false, features = ["std"] }
simdutf8 = { version = "0.1.5", default-features = false, features = ["std"] }
Expand Down
5 changes: 1 addition & 4 deletions src/serialize/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ impl Serialize for Ext {
let length = unsafe { PyBytes_GET_SIZE((*ext).data) as usize };
let data = unsafe { std::slice::from_raw_parts(buffer, length) };

serializer.serialize_newtype_struct(
rmp_serde::MSGPACK_EXT_STRUCT_NAME,
&(tag as i8, ByteBuf::from(data)),
)
serializer.serialize_newtype_variant("", tag as u32, "", &ByteBuf::from(data))
}
}
Loading

0 comments on commit 7746bc6

Please sign in to comment.