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

Take impl AsFd instead of BorrowedFd #193

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

A6GibKm
Copy link
Collaborator

@A6GibKm A6GibKm commented Feb 18, 2024

This is more general, in particular the following will still compile.

let fd = something_implementing_as_fd;
let fd: &std::os::fd::BorrowedFd<'_> = &fd.as_fd();
ashpd::any_method_using_a_fd(fd).await?;

@A6GibKm
Copy link
Collaborator Author

A6GibKm commented Feb 18, 2024

Something annoying is that with this you cannot just use HashMap::new when one of generics is impl AsFd, see the docs change.

@bilelmoussaoui
Copy link
Owner

Needs a rebase

@A6GibKm
Copy link
Collaborator Author

A6GibKm commented Oct 18, 2024

Done.

@A6GibKm A6GibKm force-pushed the as-fd branch 3 times, most recently from 99b46f9 to 13174ec Compare October 31, 2024 20:50
This is more general, in particular the following will still compile.

```rust
let fd = something_implementing_as_fd;
let fd: &std::os::fd::BorrowedFd<'_> = &fd.as_fd();
ashpd::any_method_using_a_fd(fd).await?;
```
@bilelmoussaoui bilelmoussaoui merged commit 81be274 into bilelmoussaoui:master Oct 31, 2024
10 checks passed
@bilelmoussaoui bilelmoussaoui deleted the as-fd branch October 31, 2024 20:56
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.

2 participants