Skip to content

Commit

Permalink
Merge pull request cosmos#54 from informalsystems/romac/tryinto-error
Browse files Browse the repository at this point in the history
Use explicit conversion to `anyhow::Error` to fix compilation in `no_std` mode
  • Loading branch information
ethanfrey committed Nov 1, 2021
2 parents 6cf2f71 + 9a706c2 commit 17c3466
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/src/ops.rs
Expand Up @@ -68,7 +68,7 @@ fn do_length(length: LengthOp, data: &[u8]) -> Result<Hash> {
}

fn proto_len(length: usize) -> Result<Hash> {
let size: u64 = length.try_into()?;
let size: u64 = length.try_into().map_err(anyhow::Error::msg)?;
let mut len = Hash::new();
prost::encoding::encode_varint(size, &mut len);
Ok(len)
Expand Down

0 comments on commit 17c3466

Please sign in to comment.