MCPcopy Create free account
hub / github.com/Recordscript/recordscript / path

Method path

libs/hbb_common/src/config.rs:592–615  ·  view source on GitHub ↗
(p: P)

Source from the content-addressed store, hash-verified

590 }
591
592 pub fn path<P: AsRef<Path>>(p: P) -> PathBuf {
593 #[cfg(any(target_os = "android", target_os = "ios"))]
594 {
595 let mut path: PathBuf = APP_DIR.read().unwrap().clone().into();
596 path.push(p);
597 return path;
598 }
599 #[cfg(not(any(target_os = "android", target_os = "ios")))]
600 {
601 #[cfg(not(target_os = "macos"))]
602 let org = "".to_owned();
603 #[cfg(target_os = "macos")]
604 let org = ORG.read().unwrap().clone();
605 // /var/root for root
606 if let Some(project) =
607 directories_next::ProjectDirs::from("", &org, &APP_NAME.read().unwrap())
608 {
609 let mut path = patch(project.config_dir().to_path_buf());
610 path.push(p);
611 return path;
612 }
613 "".into()
614 }
615 }
616
617 #[allow(unreachable_code)]
618 pub fn log_path() -> PathBuf {

Callers 3

link_homebrew_m1Function · 0.45
peersMethod · 0.45
read_dirFunction · 0.45

Calls 6

patchFunction · 0.85
to_stringMethod · 0.80
as_strMethod · 0.80
iterMethod · 0.80
cloneMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected