Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/revlog/revlog.rs @ 45605:1cef583541c0
hg-core: return Err if `offset != bytes.len()`
(D8958#inline-14994 followup 2/2)
[X] make `Index` owner of its bytes
[X] make `Index::new` return an error if `offset != bytes.len()`
Differential Revision: https://phab.mercurial-scm.org/D9107
author | Antoine cezar<acezar@chwitlabs.fr> |
---|---|
date | Mon, 28 Sep 2020 15:21:56 +0200 |
parents | 900b9b79b99c |
children | be951ca95b08 |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/revlog.rs Mon Sep 28 15:13:51 2020 +0200 +++ b/rust/hg-core/src/revlog/revlog.rs Mon Sep 28 15:21:56 2020 +0200 @@ -56,7 +56,7 @@ return Err(RevlogError::UnsuportedVersion(version)); } - let index = Index::new(Box::new(index_mmap)); + let index = Index::new(Box::new(index_mmap))?; // TODO load data only when needed // // type annotation required