pub fn from_bytes(bytes: &[u8]) -> Result<Oid, Error> {
        ::init();
        let mut raw = raw::git_oid { id: [0; raw::GIT_OID_RAWSZ] };
        if bytes.len() != raw::GIT_OID_RAWSZ {
            Err(Error::from_str("raw byte array must be 20 bytes"))
        } else {
            unsafe { raw::git_oid_fromraw(&mut raw, bytes.as_ptr()) }
            Ok(Oid { raw: raw })
        }
    }
/// Parse a raw object id into an Oid structure.
///
/// If the array given is not 20 bytes in length, an error is returned.
Parse a raw object id into an Oid structure.
If the array given is not 20 bytes in length, an error is returned.
Parse a raw object id into an Oid structure . If the array given is not 20 bytes in length an error is returned .
pub fn from_bytes(bytes: &[u8]) -> Result<Oid, Error> {
        ::init();
        let mut raw = raw::git_oid { id: [0; raw::GIT_OID_RAWSZ] };
        if bytes.len() != raw::GIT_OID_RAWSZ {
            Err(Error::from_str("raw byte array must be 20 bytes"))
        } else {
            unsafe { raw::git_oid_fromraw(&mut raw, bytes.as_ptr()) }
            Ok(Oid { raw: raw })
        }
    }
pub fn from_bytes ( bytes : & [ u8 ] ) -> Result < Oid , Error > { :: init ( ) ; let mut raw = raw :: git_oid { id : [ 0 ; raw :: GIT_OID_RAWSZ ] } ; if bytes . len ( ) != raw :: GIT_OID_RAWSZ { Err ( Error :: from_str ( " " ) ) } else { unsafe { raw :: git_oid_fromraw ( & mut raw , bytes . as_ptr ( ) ) } Ok ( Oid { raw : raw } ) } }
Parse a raw object id into an Oid structure.
Parse a raw object id into an Oid structure .
bytes
&[u8]
bytes
&[u8]