mirror of
https://github.com/trussed-dev/flexiber.git
synced 2026-03-11 16:35:17 -07:00
Update to heapless 0.9
This commit is contained in:
@@ -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 = []
|
||||
|
||||
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user