* claim: #6545 * cli_link: the Unix-only link code and its test build on Unix only, so the UI crate builds on Windows (#6545) slot() is used only by link_in's Unix version, and links_only_where_it_may makes its own link with std::os::unix::fs::symlink; gate both like link_in. On Windows the test failed to compile (E0433) and clippy -D warnings flagged slot as dead code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,7 @@ pub fn plan(slot: &Slot, cli: &Path) -> Plan {
|
||||
/// The folders a link goes in, best first.
|
||||
pub const DIRS: &[&str] = &["/opt/homebrew/bin", "/usr/local/bin"];
|
||||
|
||||
#[cfg(unix)]
|
||||
fn slot(link: &Path) -> Slot {
|
||||
match std::fs::symlink_metadata(link) {
|
||||
Err(_) => Slot::Empty,
|
||||
@@ -155,6 +156,8 @@ mod tests {
|
||||
assert_eq!(plan(&Slot::Other, cli), Plan::Skip);
|
||||
}
|
||||
|
||||
// `link_in` only makes links on Unix, and the test makes its own with `std::os::unix`.
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn links_only_where_it_may() {
|
||||
let d = std::env::temp_dir().join(format!("solidcraft-cli-link-{}", std::process::id()));
|
||||
|
||||
Reference in New Issue
Block a user