MCPcopy Create free account
hub / github.com/git/git / as_slice

Method as_slice

src/hash.rs:65–70  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

63 }
64
65 pub fn as_slice(&self) -> Result<&[u8], InvalidHashAlgorithm> {
66 match HashAlgorithm::from_u32(self.algo) {
67 Some(algo) => Ok(&self.hash[0..algo.raw_len()]),
68 None => Err(InvalidHashAlgorithm(self.algo)),
69 }
70 }
71
72 pub fn as_mut_slice(&mut self) -> Result<&mut [u8], InvalidHashAlgorithm> {
73 match HashAlgorithm::from_u32(self.algo) {

Callers 3

writeMethod · 0.80
look_up_objectMethod · 0.80
fmtMethod · 0.80

Calls 2

raw_lenMethod · 0.80

Tested by

no test coverage detected