Update to heapless 0.9

This commit is contained in:
Sosthène Guédon
2025-08-20 16:47:30 +02:00
parent 91151282c2
commit b56668540e
2 changed files with 4 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "flexiber"
version = "0.1.3"
version = "0.2.0"
authors = ["Nicolas Stalder <n@stalder.io>", "RustCrypto Developers"]
license = "Apache-2.0 OR MIT"
edition = "2021"
@@ -24,11 +24,11 @@ flexiber_derive = { version = "0.1.3", optional = true, path = "derive" }
flexiber_derive = { version = "=0.1.3", path = "derive" }
[dependencies.heapless]
version = "0.7.0"
version = "0.9.0"
optional = true
[dev-dependencies]
hex-literal = "0.3.1"
hex-literal = "1"
[features]
alloc = []

View File

@@ -126,10 +126,7 @@ pub trait Encodable {
pub trait EncodableHeapless: Encodable {
/// Encode this message as BER-TLV, appending it to the provided
/// heapless byte vector.
fn encode_to_heapless_vec<const N: usize>(
&self,
buf: &mut heapless::Vec<u8, N>,
) -> Result<Length> {
fn encode_to_heapless_vec(&self, buf: &mut heapless::VecView<u8>) -> Result<Length> {
let expected_len = self.encoded_length()?.to_usize();
let current_len = buf.len();
// TODO(nickray): add a specific error for "Overcapacity" conditional on heapless feature?