pub fn load_from_dir(path: &Path) -> anyhow::Result<Option<Manifest>> {
        let file_path = path.join(MANIFEST_FILE_NAME);

        let contents = match fs_err::read(&file_path) {
            Ok(contents) => contents,
            Err(err) => {
                if err.kind() == io::ErrorKind::NotFound {
                    return Ok(None);
                }

                bail!(err);
            }
        };

        let mut manifest: Manifest = toml::from_slice(&contents)
            .with_context(|| format_err!("Invalid manifest at {}", file_path.display()))?;

        manifest.path = Some(file_path);

        Ok(Some(manifest))
    }
/// Try to load an Aftman manifest from a directory containing an
/// aftman.toml file.
Try to load an Aftman manifest from a directory containing an
aftman.toml file.
Try to load an Aftman manifest from a directory containing an aftman . toml file .
pub fn load_from_dir(path: &Path) -> anyhow::Result<Option<Manifest>> {
        let file_path = path.join(MANIFEST_FILE_NAME);
        let contents = match fs_err::read(&file_path) {
            Ok(contents) => contents,
            Err(err) => {
                if err.kind() == io::ErrorKind::NotFound {
                    return Ok(None);
                }
                bail!(err);
            }
        };
        let mut manifest: Manifest = toml::from_slice(&contents)
            .with_context(|| format_err!("Invalid manifest at {}", file_path.display()))?;
        manifest.path = Some(file_path);
        Ok(Some(manifest))
    }
pub fn load_from_dir ( path : & Path ) -> anyhow :: Result < Option < Manifest > > { let file_path = path . join ( MANIFEST_FILE_NAME ) ; let contents = match fs_err :: read ( & file_path ) { Ok ( contents ) => contents , Err ( err ) => { if err . kind ( ) == io :: ErrorKind :: NotFound { return Ok ( None ) ; } bail ! ( err ) ; } } ; let mut manifest : Manifest = toml :: from_slice ( & contents ) . with_context ( | | format_err ! ( " " file_path display ( ) ) ) ? ; manifest . path = Some ( file_path ) ; Ok ( Some ( manifest ) ) }
Try to load an Aftman manifest from a directory containing an
aftman.toml file.
Try to load an Aftman manifest from a directory containing an aftman . toml file .
path
&Path
path
&Path