Skip to content

Commit

Permalink
fix IDLValue blob conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity committed Jan 30, 2024
1 parent bf95a9f commit 6a45c66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust/candid/src/types/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ impl IDLValue {
(IDLValue::Vec(vec), ty) if ty.is_blob(env) => {
let blob = vec
.iter()
.filter_map(|x| match *x {
IDLValue::Nat8(n) => Some(n),
.filter_map(|x| match x {
IDLValue::Nat8(n) => Some(*n),
IDLValue::Number(n) => n.parse::<u8>().ok(),
_ => None,
})
.collect();
Expand Down

0 comments on commit 6a45c66

Please sign in to comment.