/// Parse a hex-formatted object id into an Oid structure.
///
/// If the string is not a valid 40-character hex string, an error is
/// returned.
Parse a hex-formatted object id into an Oid structure.
If the string is not a valid 40-character hex string, an error is
returned.
Parse a hex - formatted object id into an Oid structure . If the string is not a valid 40 - character hex string an error is returned .
pub fn from_str(s: &str) -> Result<Oid, Error> {
        ::init();
        let mut raw = raw::git_oid { id: [0; raw::GIT_OID_RAWSZ] };
        unsafe {
            try_call!(raw::git_oid_fromstrn(&mut raw,
                                            s.as_bytes().as_ptr()
                                                as *const libc::c_char,
                                            s.len() as libc::size_t));
        }
        Ok(Oid { raw: raw })
    }
pub fn from_str ( s : & str ) -> Result < Oid , Error > { :: init ( ) ; let mut raw = raw :: git_oid { id : [ 0 ; raw :: GIT_OID_RAWSZ ] } ; unsafe { try_call ! ( raw git_oid_fromstrn ( mut raw s as_bytes ( ) as_ptr ( ) as const libc c_char s len ( ) as libc size_t ) ) ; } Ok ( Oid { raw : raw } ) }
Parse a hex-formatted object id into an Oid structure.
Parse a hex - formatted object id into an Oid structure .
s
&str