Skip to content

Commit a3fa7fd

Browse files
committed
Update to upstream deku 0.20.3
Previous git changes have been merged. Only API changes required are some clippy warnings. Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
1 parent 9d63573 commit a3fa7fd

3 files changed

Lines changed: 62 additions & 28 deletions

File tree

Cargo.lock

Lines changed: 55 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async-io = "2.6"
1414
chrono = { version = "0.4", default-features = false }
1515
crc = "3.3"
1616
defmt = "0.3"
17-
deku = { git = "https://github.com/CodeConstruct/deku.git", tag = "cc/deku-v0.19.1/no-alloc-3", default-features = false }
17+
deku = { version = "0.20.3", default-features = false }
1818
embedded-io-adapters = { version = "0.6", features = ["std", "futures-03"] }
1919
embedded-io-async = "0.6"
2020
embedded-io = "0.6"

pldm-platform/src/proto.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,14 @@ where
232232
) -> core::result::Result<Self, DekuError> {
233233
let Limit::Count(count) = limit else {
234234
return Err(DekuError::Assertion(
235-
"Only count implemented for heapless::Vec".into(),
235+
"Only count implemented for heapless::Vec",
236236
));
237237
};
238238

239239
let mut v = heapless::Vec::new();
240240
for _ in 0..count {
241-
v.push(T::from_reader_with_ctx(reader, ctx)?).map_err(|_| {
242-
DekuError::InvalidParam("Too many elements".into())
243-
})?
241+
v.push(T::from_reader_with_ctx(reader, ctx)?)
242+
.map_err(|_| DekuError::InvalidParam("Too many elements"))?
244243
}
245244

246245
Ok(VecWrap(v))
@@ -338,15 +337,14 @@ where
338337
) -> core::result::Result<Self, DekuError> {
339338
let Limit::Count(count) = limit else {
340339
return Err(DekuError::Assertion(
341-
"Only count implemented for heapless::Vec".into(),
340+
"Only count implemented for heapless::Vec",
342341
));
343342
};
344343

345344
let mut v = heapless::Vec::new();
346345
for _ in 0..count {
347-
v.push(u8::from_reader_with_ctx(reader, ())?).map_err(|_| {
348-
DekuError::InvalidParam("Too many elements".into())
349-
})?
346+
v.push(u8::from_reader_with_ctx(reader, ())?)
347+
.map_err(|_| DekuError::InvalidParam("Too many elements"))?
350348
}
351349

352350
Ok(AsciiString(VecWrap(v)))

0 commit comments

Comments
 (0)