Skip to content

Commit 1141831

Browse files
committed
Fix build for new XDG API change
1 parent 73f9ed8 commit 1141831

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

xrpicker-core/src/linux.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Copyright 2022-2023, Collabora, Ltd.
1+
// Copyright 2022-2025, Collabora, Ltd.
22
// SPDX-License-Identifier: MIT OR Apache-2.0
33

4-
use xdg::{BaseDirectories, BaseDirectoriesError};
4+
use xdg::BaseDirectories;
55

66
use crate::{
77
manifest::{GenericManifest, FILE_INDIRECTION_ARROW},
@@ -47,10 +47,7 @@ impl LinuxRuntime {
4747

4848
impl PlatformRuntime for LinuxRuntime {
4949
fn make_active(&self) -> Result<(), Error> {
50-
fn convert_err(e: BaseDirectoriesError) -> Error {
51-
Error::SetActiveError(e.to_string())
52-
}
53-
let dirs = BaseDirectories::new().map_err(convert_err)?;
50+
let dirs = BaseDirectories::new();
5451
let suffix = make_path_suffix();
5552
let path = dirs.place_config_file(suffix.join(ACTIVE_RUNTIME_FILENAME))?;
5653

@@ -135,9 +132,8 @@ fn is_active_runtime_name(p: &Path) -> bool {
135132
fn find_potential_manifests_xdg(suffix: &Path) -> impl Iterator<Item = PathBuf> {
136133
let suffix = suffix.to_owned();
137134
BaseDirectories::new()
138-
.ok()
135+
.list_config_files(&suffix)
139136
.into_iter()
140-
.flat_map(move |xdg_dirs| xdg_dirs.list_config_files(&suffix))
141137
.filter(|p| !is_active_runtime_name(p))
142138
}
143139

@@ -180,11 +176,7 @@ fn possible_active_runtimes() -> impl Iterator<Item = PathBuf> {
180176
let etc_iter = once(make_sysconfdir(&suffix));
181177
// Warning: BaseDirectories returns increasing order of importance, which is
182178
// opposite of what we want, so we reverse it.
183-
let xdg_iter = BaseDirectories::new()
184-
.ok()
185-
.into_iter()
186-
.flat_map(move |d| d.find_config_files(&suffix))
187-
.rev();
179+
let xdg_iter = BaseDirectories::new().find_config_files(&suffix).rev();
188180

189181
xdg_iter
190182
.chain(etc_iter)

0 commit comments

Comments
 (0)