Skip to content

Commit e501491

Browse files
karthiknadigCopilot
andcommitted
chore: fix dead_code in pet-winpython on non-Windows and lint all OSes
discover_environments_in and collect_install were gated cfg(any(windows, test)), but every caller (production and tests) is cfg(windows), so non-Windows test builds saw them as dead code. Gate them as cfg(windows) to match their callers. Verified clean via cross-target clippy for linux-gnu, apple-darwin and the host (windows). Add macOS to the lint matrix now that it is clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3b65657 commit e501491

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
os:
3737
- ubuntu-latest
3838
- windows-latest
39+
- macos-latest
3940
steps:
4041
- name: Checkout
4142
uses: actions/checkout@v4

crates/pet-winpython/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn discover_environments(locator: &WinPython) -> Vec<PythonEnvironment> {
382382

383383
/// Testable variant of [`discover_environments`] that takes the list of
384384
/// search paths as input rather than reading environment variables.
385-
#[cfg(any(windows, test))]
385+
#[cfg(windows)]
386386
fn discover_environments_in(
387387
locator: &WinPython,
388388
search_paths: Vec<PathBuf>,
@@ -430,7 +430,7 @@ fn discover_environments_in(
430430
found
431431
}
432432

433-
#[cfg(any(windows, test))]
433+
#[cfg(windows)]
434434
fn collect_install(
435435
winpython_root: &Path,
436436
locator: &WinPython,

0 commit comments

Comments
 (0)