##// END OF EJS Templates
rust-parsers: use the same error message as with the higher-level code...
Raphaël Gomès -
r52945:db5c202e default
parent child Browse files
Show More
@@ -23,8 +23,13 type ParseResult<'a> = (
23 23 pub fn parse_dirstate_parents(
24 24 contents: &[u8],
25 25 ) -> Result<&DirstateParents, HgError> {
26 let (parents, _rest) = DirstateParents::from_bytes(contents)
27 .map_err(|_| HgError::corrupted("Too little data for dirstate."))?;
26 let contents_len = contents.len();
27 let (parents, _rest) =
28 DirstateParents::from_bytes(contents).map_err(|_| {
29 HgError::corrupted(format!(
30 "Too little data for dirstate: {contents_len} bytes.",
31 ))
32 })?;
28 33 Ok(parents)
29 34 }
30 35
General Comments 0
You need to be logged in to leave comments. Login now