mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
ptp: Fix compilation with rustc 1.48
That's currently the minimum version we declare in meson.build but the latest changes introduced some usage of 1.62 features. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5265>
This commit is contained in:
parent
9d867356df
commit
a0522c8193
2 changed files with 14 additions and 5 deletions
|
@ -327,8 +327,11 @@ mod imp {
|
|||
Ok(PollResult {
|
||||
ready_sockets: &*ready_sockets,
|
||||
sockets: &self.sockets,
|
||||
stdin: (self.pollfd[self.pollfd.len() - 1].revents & POLLIN != 0)
|
||||
.then_some(&self.stdin),
|
||||
stdin: if self.pollfd[self.pollfd.len() - 1].revents & POLLIN != 0 {
|
||||
Some(&self.stdin)
|
||||
} else {
|
||||
None
|
||||
},
|
||||
stdout: &self.stdout,
|
||||
})
|
||||
}
|
||||
|
@ -866,7 +869,11 @@ mod imp {
|
|||
Ok(PollResult {
|
||||
ready_sockets: &*ready_sockets,
|
||||
sockets: &self.sockets,
|
||||
stdin: (res == self.handles.len() - 1).then_some(&self.stdin),
|
||||
stdin: if res == self.handles.len() - 1 {
|
||||
Some(&self.stdin)
|
||||
} else {
|
||||
None
|
||||
},
|
||||
stdout: &self.stdout,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ fn run() -> Result<(), Error> {
|
|||
let general_socket =
|
||||
create_socket(PTP_GENERAL_PORT).context("Failed creating general socket")?;
|
||||
|
||||
for socket in [&event_socket, &general_socket] {
|
||||
for socket in [&event_socket, &general_socket].iter() {
|
||||
net::join_multicast_v4(socket, &PTP_MULTICAST_ADDR, iface)
|
||||
.context("Failed to join multicast group")?;
|
||||
}
|
||||
|
@ -201,7 +201,9 @@ fn run() -> Result<(), Error> {
|
|||
Err(err) => {
|
||||
bail!(
|
||||
source: err,
|
||||
"Failed reading from {:?} socket for interface {}", type_, idx,
|
||||
"Failed reading from {:?} socket for interface {}",
|
||||
type_,
|
||||
idx,
|
||||
);
|
||||
}
|
||||
Ok((read, addr)) => (read, addr),
|
||||
|
|
Loading…
Reference in a new issue