Skip to content

Commit e871689

Browse files
committed
fix: unify CachedRegistryWalk across platforms to fix non-Windows build (PR #458)
1 parent 9bf31b5 commit e871689

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

  • crates/pet-windows-registry/src

crates/pet-windows-registry/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use pet_core::{
1111
Locator, LocatorKind, LocatorResult, RefreshStatePersistence, RefreshStateSyncScope,
1212
};
1313
use pet_virtualenv::is_virtualenv;
14-
#[cfg(windows)]
1514
use std::path::PathBuf;
1615
use std::sync::{Arc, Mutex};
1716

@@ -24,21 +23,18 @@ mod environments;
2423
/// reporter (not into `LocatorResult`); without remembering the dirs,
2524
/// every cache hit in `find()` would silently drop registry-only conda
2625
/// notifications (issue #454).
27-
#[cfg(windows)]
2826
struct CachedRegistryWalk {
27+
#[cfg_attr(not(windows), allow(dead_code))]
2928
result: LocatorResult,
29+
#[cfg_attr(not(windows), allow(dead_code))]
3030
conda_install_dirs: Vec<PathBuf>,
3131
}
3232

3333
pub struct WindowsRegistry {
3434
#[allow(dead_code)]
3535
conda_locator: Arc<dyn CondaLocator>,
3636
#[allow(dead_code)]
37-
#[cfg(windows)]
3837
search_result: Arc<Mutex<Option<Arc<CachedRegistryWalk>>>>,
39-
#[allow(dead_code)]
40-
#[cfg(not(windows))]
41-
search_result: Arc<Mutex<Option<Arc<LocatorResult>>>>,
4238
}
4339

4440
impl WindowsRegistry {
@@ -262,7 +258,6 @@ mod tests {
262258
WindowsRegistry::from(Arc::new(Conda::from(&environment)))
263259
}
264260

265-
#[cfg(windows)]
266261
fn wrap_cached(result: LocatorResult) -> Arc<CachedRegistryWalk> {
267262
Arc::new(CachedRegistryWalk {
268263
result,

0 commit comments

Comments
 (0)