Skip to content

Commit

Permalink
os::fd -> os::unix::prelude
Browse files Browse the repository at this point in the history
The std::os::fd module isn't available until Rust 1.66
  • Loading branch information
i509VCB committed Nov 11, 2023
1 parent c001be1 commit aba1871
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions glutin/src/api/egl/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,12 @@ impl Display {
/// This function returns [`ErrorKind::NotSupported`] if the
/// `EGL_ANDROID_native_fence_sync` extension is not available.
#[cfg(unix)]
pub fn import_sync(&self, fd: std::os::fd::BorrowedFd<'_>) -> Result<super::sync::Sync> {
pub fn import_sync(
&self,
fd: std::os::unix::prelude::BorrowedFd<'_>,
) -> Result<super::sync::Sync> {
use std::mem;
use std::os::fd::AsRawFd;
use std::os::unix::prelude::AsRawFd;

// The specification states that EGL_KHR_fence_sync must be available,
// and therefore does not need to be tested.
Expand Down
4 changes: 2 additions & 2 deletions glutin/src/api/egl/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ impl Sync {
/// `EGL_ANDROID_native_fence_sync` extension is available.
#[cfg(unix)]
#[must_use]
pub fn export_sync_fd(&self) -> Result<std::os::fd::OwnedFd> {
pub fn export_sync_fd(&self) -> Result<std::os::unix::prelude::OwnedFd> {
// Invariants:
// - EGL_KHR_fence_sync must be supported if a Sync is creatable.
use std::os::fd::FromRawFd;
use std::os::unix::prelude::FromRawFd;

Check warning on line 94 in glutin/src/api/egl/sync.rs

View workflow job for this annotation

GitHub Actions / Tests (1.65.0, x86_64-unknown-linux-gnu, ubuntu-latest)

unused import: `std::os::unix::prelude::FromRawFd`

Check warning on line 94 in glutin/src/api/egl/sync.rs

View workflow job for this annotation

GitHub Actions / Tests (1.65.0, x86_64-unknown-linux-gnu, ubuntu-latest, --no-default-features, egl,x11)

unused import: `std::os::unix::prelude::FromRawFd`

Check warning on line 94 in glutin/src/api/egl/sync.rs

View workflow job for this annotation

GitHub Actions / Tests (1.65.0, x86_64-unknown-linux-gnu, ubuntu-latest, --no-default-features, egl,wayland)

unused import: `std::os::unix::prelude::FromRawFd`

Check warning on line 94 in glutin/src/api/egl/sync.rs

View workflow job for this annotation

GitHub Actions / Tests (1.65.0, x86_64-unknown-linux-gnu, ubuntu-latest, --no-default-features, egl,wayland,x11)

unused import: `std::os::unix::prelude::FromRawFd`

Check warning on line 94 in glutin/src/api/egl/sync.rs

View workflow job for this annotation

GitHub Actions / Tests (1.65.0, i686-unknown-linux-gnu, ubuntu-latest)

unused import: `std::os::unix::prelude::FromRawFd`

// Check the type of the fence to see if it can be exported.
let ty = unsafe { self.get_attrib(egl::SYNC_TYPE) }?;
Expand Down

0 comments on commit aba1871

Please sign in to comment.