ohos: Remove unneeded dirs dependency in servo_config (#34166)

`dirs` does not support OpenHarmony, and it also seems that
there currently is no native API that `dirs` could use on
OpenHarmony and the directory needs to be read from ArkTS.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This commit is contained in:
Jonathan Schwender 2024-11-06 16:58:46 +01:00 committed by GitHub
parent 2f6ca9407b
commit 07aa561295
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -25,5 +25,5 @@ servo_url = { path = "../url" }
style_config = { workspace = true }
url = { workspace = true }
[target.'cfg(not(target_os = "android"))'.dependencies]
[target.'cfg(not(any(target_os = "android", target_env = "ohos")))'.dependencies]
dirs = "5.0"

View file

@ -12,7 +12,8 @@ use std::path::PathBuf;
unix,
not(target_os = "macos"),
not(target_os = "ios"),
not(target_os = "android")
not(target_os = "android"),
not(target_env = "ohos")
))]
pub fn default_config_dir() -> Option<PathBuf> {
let mut config_dir = ::dirs::config_dir().unwrap();
@ -21,7 +22,7 @@ pub fn default_config_dir() -> Option<PathBuf> {
Some(config_dir)
}
#[cfg(target_os = "android")]
#[cfg(any(target_os = "android", target_env = "ohos"))]
pub fn default_config_dir() -> Option<PathBuf> {
None
}