Use #[non_exhaustive] in lieu of _NonExhaustive enum variant.

This commit is contained in:
Tim Kuehn
2020-06-26 19:47:20 -07:00
parent f0322fb892
commit e9b1e7d101
2 changed files with 1 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ use std::{io, time::SystemTime};
/// A message from a client to a server.
#[derive(Debug)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
pub enum ClientMessage<T> {
/// A request initiated by a user. The server responds to a request by invoking a
/// service-provided request handler. The handler completes with a [`response`](Response), which
@@ -58,8 +59,6 @@ pub enum ClientMessage<T> {
/// The ID of the request to cancel.
request_id: u64,
},
#[doc(hidden)]
_NonExhaustive,
}
/// A request from a client to a server.

View File

@@ -304,7 +304,6 @@ where
} => {
self.as_mut().cancel_request(&trace_context, request_id);
}
ClientMessage::_NonExhaustive => unreachable!(),
},
None => return Poll::Ready(None),
}