sync: make SendError field public (#4097)

This commit is contained in:
Alice Ryhl
2021-09-09 19:13:26 +02:00
committed by GitHub
parent 6ebd0575e4
commit b99eedc2ea
+2 -4
View File
@@ -123,9 +123,7 @@ pub mod error {
/// Error produced when sending a value fails.
#[derive(Debug)]
pub struct SendError<T> {
pub(crate) inner: T,
}
pub struct SendError<T>(pub T);
// ===== impl SendError =====
@@ -431,7 +429,7 @@ impl<T> Sender<T> {
pub fn send(&self, value: T) -> Result<(), error::SendError<T>> {
// This is pretty much only useful as a hint anyway, so synchronization isn't critical.
if 0 == self.receiver_count() {
return Err(error::SendError { inner: value });
return Err(error::SendError(value));
}
{