File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -1753,6 +1753,18 @@ fn user_config_dir() -> Option<PathBuf> {
17531753 }
17541754}
17551755
1756+ fn system_config_dir ( ) -> Option < PathBuf > {
1757+ #[ cfg( target_os = "macos" ) ]
1758+ {
1759+ Some ( PathBuf :: from ( "/Library/Application Support/ADBC" ) )
1760+ }
1761+
1762+ #[ cfg( all( unix, not( target_os = "macos" ) ) ) ]
1763+ {
1764+ Some ( PathBuf :: from ( "/etc/adbc" ) )
1765+ }
1766+ }
1767+
17561768fn get_search_paths ( lvls : LoadFlags ) -> Vec < PathBuf > {
17571769 let mut result = Vec :: new ( ) ;
17581770 if lvls & LOAD_FLAG_SEARCH_ENV != 0 {
@@ -1774,13 +1786,10 @@ fn get_search_paths(lvls: LoadFlags) -> Vec<PathBuf> {
17741786 // system level for windows is to search the registry keys
17751787 #[ cfg( not( windows) ) ]
17761788 if lvls & LOAD_FLAG_SEARCH_SYSTEM != 0 {
1777- #[ cfg( target_os = "macos" ) ]
1778- let system_config_dir = PathBuf :: from ( "/Library/Application Support/ADBC" ) ;
1779- #[ cfg( not( target_os = "macos" ) ) ]
1780- let system_config_dir = PathBuf :: from ( "/etc/adbc" ) ;
1781-
1782- if system_config_dir. exists ( ) {
1783- result. push ( system_config_dir) ;
1789+ if let Some ( path) = system_config_dir ( ) {
1790+ if path. exists ( ) {
1791+ result. push ( path) ;
1792+ }
17841793 }
17851794 }
17861795
You can’t perform that action at this time.
0 commit comments