pub fn initialize() -> std::io::Result<Paths> {
        let pd = ProjectDirs::from("com.github.target.lorri", "lorri", "lorri")
            .expect("Could not determine lorri project/cache directories, please set $HOME");
        let create_dir = |dir: PathBuf| -> std::io::Result<PathBuf> {
            std::fs::create_dir_all(&dir).and(Ok(dir))
        };
        Ok(Paths {
            gc_root_dir: create_dir(pd.cache_dir().join("gc_roots"))?,
            daemon_socket_file: create_dir(
                pd.runtime_dir()
                    // fall back to the cache dir on non-linux
                    .unwrap_or_else(|| pd.cache_dir())
                    .to_owned(),
            )?
            .join("daemon.socket"),
        })
    }
/// Set up project paths, creating directories if necessary.
Set up project paths, creating directories if necessary.
Set up project paths creating directories if necessary .
pub fn initialize() -> std::io::Result<Paths> {
        let pd = ProjectDirs::from("com.github.target.lorri", "lorri", "lorri")
            .expect("Could not determine lorri project/cache directories, please set $HOME");
        let create_dir = |dir: PathBuf| -> std::io::Result<PathBuf> {
            std::fs::create_dir_all(&dir).and(Ok(dir))
        };
        Ok(Paths {
            gc_root_dir: create_dir(pd.cache_dir().join("gc_roots"))?,
            daemon_socket_file: create_dir(
                pd.runtime_dir()
                    // fall back to the cache dir on non-linux
                    .unwrap_or_else(|| pd.cache_dir())
                    .to_owned(),
            )?
            .join("daemon.socket"),
        })
    }
pub fn initialize ( ) -> std :: io :: Result < Paths > { let pd = ProjectDirs :: from ( " " , " " , " " ) . expect ( " " ) ; let create_dir = | dir : PathBuf | -> std :: io :: Result < PathBuf > { std :: fs :: create_dir_all ( & dir ) . and ( Ok ( dir ) ) } ; Ok ( Paths { gc_root_dir : create_dir ( pd . cache_dir ( ) . join ( " " ) ) ? , daemon_socket_file : create_dir ( pd . runtime_dir ( ) // fall back to the cache dir on non-linux . unwrap_or_else ( | | pd . cache_dir ( ) ) . to_owned ( ) , ) ? . join ( " " ) , } ) }
Set up project paths, creating directories if necessary.
Set up project paths creating directories if necessary .