]> git.proxmox.com Git - rustc.git/blob - vendor/dirs/src/mac.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / vendor / dirs / src / mac.rs
1 extern crate dirs_sys;
2
3 use std::path::PathBuf;
4
5 pub fn home_dir() -> Option<PathBuf> { dirs_sys::home_dir() }
6
7 pub fn cache_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Library/Caches")) }
8 pub fn config_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Library/Application Support")) }
9 pub fn data_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Library/Application Support")) }
10 pub fn data_local_dir() -> Option<PathBuf> { data_dir() }
11 pub fn preference_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Library/Preferences")) }
12 pub fn executable_dir() -> Option<PathBuf> { None }
13 pub fn runtime_dir() -> Option<PathBuf> { None }
14 pub fn state_dir() -> Option<PathBuf> { None }
15
16 pub fn audio_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Music")) }
17 pub fn desktop_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Desktop")) }
18 pub fn document_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Documents")) }
19 pub fn download_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Downloads")) }
20 pub fn font_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Library/Fonts")) }
21 pub fn picture_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Pictures")) }
22 pub fn public_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Public")) }
23 pub fn template_dir() -> Option<PathBuf> { None }
24 pub fn video_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Movies")) }