mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #20177 - petre2dor:removeUnusedCode, r=jdm
removed default_data_dir() and default_cache_dir() <!-- Please describe your changes on the following line: --> I removed `default_data_dir()` and `default_cache_dir()` from `components/config/basedir.rs` because they were never called. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they only remove untested code <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20177) <!-- Reviewable:end -->
This commit is contained in:
commit
0eb8b1f4c0
1 changed files with 0 additions and 34 deletions
|
@ -31,40 +31,6 @@ pub fn default_config_dir() -> PathBuf {
|
|||
PathBuf::from(dir.to_str().unwrap())
|
||||
}
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
|
||||
pub fn default_data_dir() -> Option<PathBuf> {
|
||||
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
|
||||
let data_dir = xdg_dirs.get_data_home();
|
||||
Some(data_dir)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
#[allow(unsafe_code)]
|
||||
pub fn default_data_dir() -> Option<PathBuf> {
|
||||
let dir = unsafe {
|
||||
CStr::from_ptr((*android_injected_glue::get_app().activity).internalDataPath)
|
||||
};
|
||||
Some(PathBuf::from(dir.to_str().unwrap()))
|
||||
}
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
|
||||
pub fn default_cache_dir() -> Option<PathBuf> {
|
||||
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
|
||||
let cache_dir = xdg_dirs.get_cache_home();
|
||||
Some(cache_dir)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
#[allow(unsafe_code)]
|
||||
pub fn default_cache_dir() -> Option<PathBuf> {
|
||||
// TODO: Use JNI to call context.getCacheDir().
|
||||
// There is no equivalent function in NDK/NativeActivity.
|
||||
let dir = unsafe {
|
||||
CStr::from_ptr((*android_injected_glue::get_app().activity).externalDataPath)
|
||||
};
|
||||
Some(PathBuf::from(dir.to_str().unwrap()))
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn default_config_dir() -> PathBuf {
|
||||
let mut config_dir = env::home_dir().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue