fn find_dotrc(partial_config: &PartialConfig) -> Option<AbsolutePath> {
    let config = partial_config.to_config().ok()?;

    // Try to check if a dotrc was among the files discovered from partial_config
    let items = crate::resolver::get_items(&config).ok()?;
    for item in items {
        match item.dest.file_name() {
            Some(name) if DOTRC_NAMES.contains(&name) => {
                verbose_println!("Discovered dotrc at {}", item.source);
                return Some(item.source.clone());
            },
            _ => (),
        }
    }

    // Otherwise, try to find a dotrc in the home directory
    for dotrc_name in DOTRC_NAMES.iter() {
        let dotrc_path = util::home_dir().join(dotrc_name);
        if dotrc_path.exists() {
            return Some(AbsolutePath::from(dotrc_path));
        }
    }

    None
}
/// Given the partial config built from CLI arguments and default values, tries
/// to find the dotrc file.
///
/// Searches the following locations, in order:
/// - The `host-` folder matching the hostname in `partial_config`
/// - Any `tag-` folders matching the tags in `partial_config` (the tags are
///   searched in an unspecified order)
/// - The default location (`~/.dotrc`)
Given the partial config built from CLI arguments and default values, tries
to find the dotrc file.


Given the partial config built from CLI arguments and default values tries to find the dotrc file .
fn find_dotrc(partial_config: &PartialConfig) -> Option<AbsolutePath> {
    let config = partial_config.to_config().ok()?;
    // Try to check if a dotrc was among the files discovered from partial_config
    let items = crate::resolver::get_items(&config).ok()?;
    for item in items {
        match item.dest.file_name() {
            Some(name) if DOTRC_NAMES.contains(&name) => {
                verbose_println!("Discovered dotrc at {}", item.source);
                return Some(item.source.clone());
            },
            _ => (),
        }
    }
    // Otherwise, try to find a dotrc in the home directory
    for dotrc_name in DOTRC_NAMES.iter() {
        let dotrc_path = util::home_dir().join(dotrc_name);
        if dotrc_path.exists() {
            return Some(AbsolutePath::from(dotrc_path));
        }
    }
    None
}
fn find_dotrc ( partial_config : & PartialConfig ) -> Option < AbsolutePath > { let config = partial_config . to_config ( ) . ok ( ) ? ; // Try to check if a dotrc was among the files discovered from partial_config let items = crate :: resolver :: get_items ( & config ) . ok ( ) ? ; for item in items { match item . dest . file_name ( ) { Some ( name ) if DOTRC_NAMES . contains ( & name ) => { verbose_println ! ( " " item source ) ; return Some ( item . source . clone ( ) ) ; } , _ => ( ) , } } // Otherwise, try to find a dotrc in the home directory for dotrc_name in DOTRC_NAMES . iter ( ) { let dotrc_path = util :: home_dir ( ) . join ( dotrc_name ) ; if dotrc_path . exists ( ) { return Some ( AbsolutePath :: from ( dotrc_path ) ) ; } } None }
Given the partial config built from CLI arguments and default values, tries
to find the dotrc file.
Given the partial config built from CLI arguments and default values tries to find the dotrc file .
partial_config
&PartialConfig
partial_config
&PartialConfig