diff options
author | Jonathan Schwender <55576758+jschwe@users.noreply.github.com> | 2024-11-06 16:58:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-06 15:58:46 +0000 |
commit | 07aa561295895cca5ea2afcb5db9775f3bbd4c77 (patch) | |
tree | 33da6e4c943b1da35154e0c89ca81d82bf413323 | |
parent | 2f6ca9407bf28245b74304ee981080ecf12265cb (diff) | |
download | servo-07aa561295895cca5ea2afcb5db9775f3bbd4c77.tar.gz servo-07aa561295895cca5ea2afcb5db9775f3bbd4c77.zip |
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>
-rw-r--r-- | components/config/Cargo.toml | 2 | ||||
-rw-r--r-- | components/config/basedir.rs | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml index 8a0600f35e4..ea2feb49b5e 100644 --- a/components/config/Cargo.toml +++ b/components/config/Cargo.toml @@ -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" diff --git a/components/config/basedir.rs b/components/config/basedir.rs index a7e5226dea9..2fa70408a34 100644 --- a/components/config/basedir.rs +++ b/components/config/basedir.rs @@ -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 } |