Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unistd: allow linkat to take multiple path types #2582

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

hdonnay
Copy link
Contributor

@hdonnay hdonnay commented Jan 13, 2025

What does this PR do

Add a second type parameter to linkat to allow the two paths to have different backing types.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

I'm unsure if this warrants additional tests, or if it qualifies as an API change. (I guess it technically is, but it doesn't change the usage in any way.)

LMK if I need to add either, or if there are other instances of this (unintentional(?) type parameter re-use) that I can clean up.

@asomers
Copy link
Member

asomers commented Jan 13, 2025

This is technically a breaking change, even though most users' code will compile just fine. But it needs a changelog entry, and ideally a test that wouldn't have passed without this patch.

Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SteveLauC SteveLauC requested a review from asomers January 14, 2025 01:22
test/test_unistd.rs Outdated Show resolved Hide resolved
Other places in the crate take independent types in use cases like this,
so bring `linkat` into line with them.

Signed-off-by: Hank Donnay <[email protected]>
@hdonnay hdonnay requested a review from asomers January 14, 2025 16:01
@asomers asomers added this pull request to the merge queue Jan 14, 2025
Merged via the queue into nix-rust:master with commit 52f4380 Jan 14, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants