fn ucd_directory_version_inner(
        ucd_dir: &Path,
    ) -> Result<(u64, u64, u64), Error> {
        lazy_static::lazy_static! {
            static ref VERSION_RX: Regex =
                Regex::new(r"-([0-9]+).([0-9]+).([0-9]+).txt").unwrap();
        }

        let proplist = ucd_dir.join("PropList.txt");
        let contents = first_line(&proplist)?;
        let caps = match VERSION_RX.captures(&contents) {
            Some(c) => c,
            None => {
                return err!("Failed to find version in line {:?}", contents)
            }
        };

        let capture_to_num = |n| {
            caps.get(n).unwrap().as_str().parse::<u64>().map_err(|e| Error {
                kind: ErrorKind::Parse(format!(
                    "Failed to parse version from {:?} in PropList.txt: {}",
                    contents, e
                )),
                line: Some(0),
                path: Some(proplist.clone()),
            })
        };
        let major = capture_to_num(1)?;
        let minor = capture_to_num(2)?;
        let patch = capture_to_num(3)?;

        Ok((major, minor, patch))
    }
// Avoid duplication from generic path parameter.
Avoid duplication from generic path parameter.
Avoid duplication from generic path parameter .
fn ucd_directory_version_inner(
        ucd_dir: &Path,
    ) -> Result<(u64, u64, u64), Error> {
        lazy_static::lazy_static! {
            static ref VERSION_RX: Regex =
                Regex::new(r"-([0-9]+).([0-9]+).([0-9]+).txt").unwrap();
        }
        let proplist = ucd_dir.join("PropList.txt");
        let contents = first_line(&proplist)?;
        let caps = match VERSION_RX.captures(&contents) {
            Some(c) => c,
            None => {
                return err!("Failed to find version in line {:?}", contents)
            }
        };
        let capture_to_num = |n| {
            caps.get(n).unwrap().as_str().parse::<u64>().map_err(|e| Error {
                kind: ErrorKind::Parse(format!(
                    "Failed to parse version from {:?} in PropList.txt: {}",
                    contents, e
                )),
                line: Some(0),
                path: Some(proplist.clone()),
            })
        };
        let major = capture_to_num(1)?;
        let minor = capture_to_num(2)?;
        let patch = capture_to_num(3)?;
        Ok((major, minor, patch))
    }
fn ucd_directory_version_inner ( ucd_dir : & Path , ) -> Result < ( u64 , u64 , u64 ) , Error > { lazy_static :: lazy_static ! { static ref VERSION_RX Regex Regex new ( r"-([0-9]+).([0-9]+).([0-9]+).txt" ) unwrap ( ) } let proplist = ucd_dir . join ( " " ) ; let contents = first_line ( & proplist ) ? ; let caps = match VERSION_RX . captures ( & contents ) { Some ( c ) => c , None => { return err ! ( " " contents ) } } ; let capture_to_num = | n | { caps . get ( n ) . unwrap ( ) . as_str ( ) . parse :: < u64 > ( ) . map_err ( | e | Error { kind : ErrorKind :: Parse ( format ! ( " " contents e ) ) , line : Some ( 0 ) , path : Some ( proplist . clone ( ) ) , } ) } ; let major = capture_to_num ( 1 ) ? ; let minor = capture_to_num ( 2 ) ? ; let patch = capture_to_num ( 3 ) ? ; Ok ( ( major , minor , patch ) ) }
Avoid duplication from generic path parameter.
Avoid duplication from generic path parameter .
ucd_dir
&Path
ucd_dir
&Path