History

all docs for git-commitgraph::file

Sebastian Thiel committed 5 years ago

Commit 8b262011 parent 23bba1c6 files · +54 −20Browse files

Showing the changes to git-commitgraph/src/file/init.rs (1 of 6 files). Show all

Unified · Split

git-commitgraph/src/file/init.rs+3−0
@@ -11,7 +11,9 @@ use std::{ · 10 unmodified lines
11 11
12type ChunkId = [u8; 4];12type ChunkId = [u8; 4];
13 13
14/// The error used in [`File::at()`].
14#[derive(thiserror::Error, Debug)]15#[derive(thiserror::Error, Debug)]
16#[allow(missing_docs)]
15pub enum Error {17pub enum Error {
16 #[error("Commit-graph {:?} chunk contains {from_chunk} base graphs, but commit-graph file header claims {from_header} base graphs", BASE_GRAPHS_LIST_CHUNK_ID.as_bstr())]18 #[error("Commit-graph {:?} chunk contains {from_chunk} base graphs, but commit-graph file header claims {from_header} base graphs", BASE_GRAPHS_LIST_CHUNK_ID.as_bstr())]
17 BaseGraphMismatch { from_header: u8, from_chunk: u32 },19 BaseGraphMismatch { from_header: u8, from_chunk: u32 },
@@ -63,6 +65,7 @@ const OID_LOOKUP_CHUNK_ID: ChunkId = *b"OIDL"; · 45 unmodified lines
63const SENTINEL_CHUNK_ID: ChunkId = [0u8; 4];65const SENTINEL_CHUNK_ID: ChunkId = [0u8; 4];
64 66
65impl File {67impl File {
68 /// Try to parse the commit graph file at `path`.
66 pub fn at(path: impl AsRef<Path>) -> Result<File, Error> {69 pub fn at(path: impl AsRef<Path>) -> Result<File, Error> {
67 Self::try_from(path.as_ref())70 Self::try_from(path.as_ref())
68 }71 }