Skip to content

Commit

Permalink
Attempt to improve size
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Oct 7, 2024
1 parent 4bf2788 commit f117b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serde = { version = "1", default-features = false, features = ["derive"] }
serde_bytes = "0.11.12"

[features]
heapless-bytes-v0-3 = ["dep:heapless-bytes-v0-3"]
heapless-bytes-v0-3 = ["dep:heapless-bytes-v0-3", "heapless-v0-7"]
heapless-bytes-v0-4 = ["dep:heapless-bytes-v0-4"]
heapless-v0-7 = ["dep:heapless-v0-7"]
heapless-v0-8 = ["dep:heapless-v0-8"]
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ pub fn cbor_serialize_extending_bytes<T: ?Sized + serde::Serialize, const N: usi
bytes: &mut heapless_bytes_v0_3::Bytes<N>,
) -> Result<usize> {
let len_before = bytes.len();
let mut ser = ser::Serializer::new(bytes);
let vec: &mut heapless_v0_7::Vec<u8, N> = bytes;
let mut ser = ser::Serializer::new(vec);

object.serialize(&mut ser)?;

Expand Down

0 comments on commit f117b49

Please sign in to comment.