bilelmoussaoui / ashpd

A Rust wrapper around XDG portals DBus interfaces
https://bilelmoussaoui.github.io/ashpd/ashpd/
MIT License
234 stars 45 forks source link

Take impl AsFd instead of BorrowedFd #193

Open A6GibKm opened 7 months ago

A6GibKm commented 7 months ago

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 commented 7 months ago

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