fn parse_config_files(mut config: &mut Self) -> Result<()> {
        // Next, we parse the ferox-config.toml file, if present and set the values
        // therein to overwrite our default values. Deserialized defaults are specified
        // in the Configuration struct so that we don't change anything that isn't
        // actually specified in the config file
        //
        // search for a config using the following order of precedence
        //   - /etc/feroxbuster/
        //   - CONFIG_DIR/ferxobuster/
        //   - same directory as feroxbuster executable
        //   - current directory

        // merge a config found at /etc/feroxbuster/ferox-config.toml
        let config_file = PathBuf::new()
            .join("/etc/feroxbuster")
            .join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;

        // merge a config found at ~/.config/feroxbuster/ferox-config.toml
        // config_dir() resolves to one of the following
        //   - linux: $XDG_CONFIG_HOME or $HOME/.config
        //   - macOS: $HOME/Library/Application Support
        //   - windows: {FOLDERID_RoamingAppData}
        let config_dir = dirs::config_dir().ok_or_else(|| anyhow!("Couldn't load config"))?;
        let config_file = config_dir.join("feroxbuster").join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;

        // merge a config found in same the directory as feroxbuster executable
        let exe_path = current_exe()?;
        let bin_dir = exe_path
            .parent()
            .ok_or_else(|| anyhow!("Couldn't load config"))?;
        let config_file = bin_dir.join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;

        // merge a config found in the user's current working directory
        let cwd = current_dir()?;
        let config_file = cwd.join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;

        Ok(())
    }
/// Parse all possible versions of the ferox-config.toml file, adhering to the order of
/// precedence outlined above
Parse all possible versions of the ferox-config.toml file, adhering to the order of
precedence outlined above
Parse all possible versions of the ferox - config . toml file adhering to the order of precedence outlined above
fn parse_config_files(mut config: &mut Self) -> Result<()> {
        // Next, we parse the ferox-config.toml file, if present and set the values
        // therein to overwrite our default values. Deserialized defaults are specified
        // in the Configuration struct so that we don't change anything that isn't
        // actually specified in the config file
        //
        // search for a config using the following order of precedence
        //   - /etc/feroxbuster/
        //   - CONFIG_DIR/ferxobuster/
        //   - same directory as feroxbuster executable
        //   - current directory
        // merge a config found at /etc/feroxbuster/ferox-config.toml
        let config_file = PathBuf::new()
            .join("/etc/feroxbuster")
            .join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;
        // merge a config found at ~/.config/feroxbuster/ferox-config.toml
        // config_dir() resolves to one of the following
        //   - linux: $XDG_CONFIG_HOME or $HOME/.config
        //   - macOS: $HOME/Library/Application Support
        //   - windows: {FOLDERID_RoamingAppData}
        let config_dir = dirs::config_dir().ok_or_else(|| anyhow!("Couldn't load config"))?;
        let config_file = config_dir.join("feroxbuster").join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;
        // merge a config found in same the directory as feroxbuster executable
        let exe_path = current_exe()?;
        let bin_dir = exe_path
            .parent()
            .ok_or_else(|| anyhow!("Couldn't load config"))?;
        let config_file = bin_dir.join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;
        // merge a config found in the user's current working directory
        let cwd = current_dir()?;
        let config_file = cwd.join(DEFAULT_CONFIG_NAME);
        Self::parse_and_merge_config(config_file, &mut config)?;
        Ok(())
    }
fn parse_config_files ( mut config : & mut Self ) -> Result < ( ) > { // Next, we parse the ferox-config.toml file, if present and set the values // therein to overwrite our default values. Deserialized defaults are specified // in the Configuration struct so that we don't change anything that isn't // actually specified in the config file // // search for a config using the following order of precedence //   - /etc/feroxbuster/ //   - CONFIG_DIR/ferxobuster/ //   - same directory as feroxbuster executable //   - current directory // merge a config found at /etc/feroxbuster/ferox-config.toml let config_file = PathBuf :: new ( ) . join ( " " ) . join ( DEFAULT_CONFIG_NAME ) ; Self :: parse_and_merge_config ( config_file , & mut config ) ? ; // merge a config found at ~/.config/feroxbuster/ferox-config.toml // config_dir() resolves to one of the following //   - linux: $XDG_CONFIG_HOME or $HOME/.config //   - macOS: $HOME/Library/Application Support //   - windows: {FOLDERID_RoamingAppData} let config_dir = dirs :: config_dir ( ) . ok_or_else ( | | anyhow ! ( " " ) ) ? ; let config_file = config_dir . join ( " " ) . join ( DEFAULT_CONFIG_NAME ) ; Self :: parse_and_merge_config ( config_file , & mut config ) ? ; // merge a config found in same the directory as feroxbuster executable let exe_path = current_exe ( ) ? ; let bin_dir = exe_path . parent ( ) . ok_or_else ( | | anyhow ! ( " " ) ) ? ; let config_file = bin_dir . join ( DEFAULT_CONFIG_NAME ) ; Self :: parse_and_merge_config ( config_file , & mut config ) ? ; // merge a config found in the user's current working directory let cwd = current_dir ( ) ? ; let config_file = cwd . join ( DEFAULT_CONFIG_NAME ) ; Self :: parse_and_merge_config ( config_file , & mut config ) ? ; Ok ( ( ) ) }
Parse all possible versions of the ferox-config.toml file, adhering to the order of
precedence outlined above
Parse all possible versions of the ferox - config . toml file adhering to the order of precedence outlined above
config
&mut Self