Skip to content

Commit

Permalink
Relax lifetime requirements for PollFd::new
Browse files Browse the repository at this point in the history
Fixes #2118
  • Loading branch information
asomers committed Sep 23, 2023
1 parent b869424 commit f6b02bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased] - ReleaseDate

### Fixed

- Relaxed lifetime requirements for `PollFd::new`.
([#2133](https://github.com/nix-rust/nix/pull/2133))

## [0.27.1] - 2023-08-28

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<'fd> PollFd<'fd> {
//
// // Do something with `pollfd`, which uses the CLOSED fd.
// ```
pub fn new<Fd: AsFd>(fd: &'fd Fd, events: PollFlags) -> PollFd<'fd> {
pub fn new<Fd: AsFd + 'fd>(fd: &Fd, events: PollFlags) -> PollFd<'fd> {
PollFd {
pollfd: libc::pollfd {
fd: fd.as_fd().as_raw_fd(),
Expand Down

0 comments on commit f6b02bb

Please sign in to comment.