Proper case for TimedOut variant

This commit is contained in:
Mathieu Trossevin 2024-01-05 22:51:28 +01:00
parent 6dae26212d
commit 31d681ba2a
2 changed files with 4 additions and 4 deletions

View file

@ -127,7 +127,7 @@ pub enum BarrierError {
Notify(NotifyError), Notify(NotifyError),
FailedPipeCreation(Errno), FailedPipeCreation(Errno),
FailedPolling(Errno), FailedPolling(Errno),
Timedout, TimedOut,
} }
impl From<NotifyError> for BarrierError { impl From<NotifyError> for BarrierError {
@ -145,7 +145,7 @@ impl Display for BarrierError {
"Couldn't create pipe to serve as a notify syncronisation barrier : error {errno}." "Couldn't create pipe to serve as a notify syncronisation barrier : error {errno}."
), ),
Self::FailedPolling(errno) => write!(f, "poll failed with error : {errno}."), Self::FailedPolling(errno) => write!(f, "poll failed with error : {errno}."),
Self::Timedout => write!(f, "Notification synchronisation timed out."), Self::TimedOut => write!(f, "Notification synchronisation timed out."),
} }
} }
} }
@ -156,7 +156,7 @@ impl Error for BarrierError {
Self::Notify(source) => Some(source), Self::Notify(source) => Some(source),
Self::FailedPipeCreation(source) => Some(source), Self::FailedPipeCreation(source) => Some(source),
Self::FailedPolling(source) => Some(source), Self::FailedPolling(source) => Some(source),
Self::Timedout => None, Self::TimedOut => None,
} }
} }
} }

View file

@ -186,7 +186,7 @@ impl Notifier {
.map_err(BarrierError::FailedPolling) .map_err(BarrierError::FailedPolling)
.and_then(|events| { .and_then(|events| {
if events == 0_usize { if events == 0_usize {
return Err(BarrierError::Timedout); return Err(BarrierError::TimedOut);
} }
Ok(()) Ok(())
}) })