Skip to content

Commit c50db67

Browse files
committed
refactor
1 parent b7add37 commit c50db67

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

grovedb/src/replication.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@ pub fn util_split_global_chunk_id(
115115
pub fn util_encode_vec_ops(chunk: Vec<Op>) -> Result<Vec<u8>, Error> {
116116
let mut res = vec![];
117117
for op in chunk {
118-
if op.encode_into(&mut res).is_err() {
119-
return Err(Error::CorruptedData("unable to encode chunk".to_string()));
120-
}
118+
op.encode_into(&mut res)
119+
.map_err(|e| Error::CorruptedData(format!("unable to encode chunk: {}", e)))?;
121120
}
122-
123121
Ok(res)
124122
}
125123

0 commit comments

Comments
 (0)