Skip to content

Commit 828a12c

Browse files
committed
Lazily evaluate error
1 parent 9344dc9 commit 828a12c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ where
172172
.as_ref()
173173
.first()
174174
.copied()
175-
.ok_or(anyhow!("end of data"))
175+
.ok_or_else(|| anyhow!("end of data"))
176176
}
177177

178178
fn decode_dag_cbor_to_pyobject<'de, R: dec::Read<'de>>(

0 commit comments

Comments
 (0)