Documentation
1
2
3
4
5
6
7
8
9
10
11
use std::path::PathBuf;

pub fn confdir() -> PathBuf {
  std::env::var("XDG_CONFIG_HOME")
    .map(|i| i.into())
    .unwrap_or_else(|_| {
      dirs::home_dir()
        .unwrap_or(PathBuf::from("/"))
        .join(".config")
    })
}