Skip to content

Commit 4610094

Browse files
committed
fix: unpack error directly
1 parent cb27859 commit 4610094

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ async fn main() -> Result<(), Box<dyn Error>> {
6060
})
6161
.collect::<Result<Vec<Vec<u8>>, Box<dyn Error>>>()?;
6262

63-
let un_mspacked: Result<Vec<MsgPack>, msgpack_simple::ParseError> =
64-
un_valued.iter().map(|e| MsgPack::parse(e)).collect();
63+
let un_mspacked = un_valued
64+
.iter()
65+
.map(|e| MsgPack::parse(e))
66+
.collect::<Result<Vec<MsgPack>, msgpack_simple::ParseError>>()?;
6567

6668
dbg!(un_mspacked);
6769

0 commit comments

Comments
 (0)