fn fix_paths(&mut self, config_path: &Path) -> Result<()> {
        fn fix_path(base_path: &Path, path: &mut PathBuf) {
            if path.is_relative() {
                *path = base_path.join(&path);
            }
        }

        let absolute_config_path = config_path.canonicalize()
            .context("failed to canonicalize config path")?;
        let base = absolute_config_path.parent()
            .expect("config file path has no parent");

        if let Some(p) = &mut self.http.unix_socket {
            fix_path(&base, p);
        }

        if let Some(p) = &mut self.log.file {
            fix_path(&base, p);
        }

        fix_path(&base, &mut self.theme.logo.large);
        fix_path(&base, &mut self.theme.logo.small);

        Ok(())
    }
/// Goes through all paths in the configuration and changes relative paths
/// to be absolute based on the path of the configuration file itself.
Goes through all paths in the configuration and changes relative paths
to be absolute based on the path of the configuration file itself.
Goes through all paths in the configuration and changes relative paths to be absolute based on the path of the configuration file itself .
fn fix_paths(&mut self, config_path: &Path) -> Result<()> {
        fn fix_path(base_path: &Path, path: &mut PathBuf) {
            if path.is_relative() {
                *path = base_path.join(&path);
            }
        }
        let absolute_config_path = config_path.canonicalize()
            .context("failed to canonicalize config path")?;
        let base = absolute_config_path.parent()
            .expect("config file path has no parent");
        if let Some(p) = &mut self.http.unix_socket {
            fix_path(&base, p);
        }
        if let Some(p) = &mut self.log.file {
            fix_path(&base, p);
        }
        fix_path(&base, &mut self.theme.logo.large);
        fix_path(&base, &mut self.theme.logo.small);
        Ok(())
    }
fn fix_paths ( & mut self , config_path : & Path ) -> Result < ( ) > { fn fix_path ( base_path : & Path , path : & mut PathBuf ) { if path . is_relative ( ) { * path = base_path . join ( & path ) ; } } let absolute_config_path = config_path . canonicalize ( ) . context ( " " ) ? ; let base = absolute_config_path . parent ( ) . expect ( " " ) ; if let Some ( p ) = & mut self . http . unix_socket { fix_path ( & base , p ) ; } if let Some ( p ) = & mut self . log . file { fix_path ( & base , p ) ; } fix_path ( & base , & mut self . theme . logo . large ) ; fix_path ( & base , & mut self . theme . logo . small ) ; Ok ( ( ) ) }
Goes through all paths in the configuration and changes relative paths
to be absolute based on the path of the configuration file itself.
Goes through all paths in the configuration and changes relative paths to be absolute based on the path of the configuration file itself .
&mut self
config_path
&Path