Skip to content

Commit

Permalink
Remove dep on never
Browse files Browse the repository at this point in the history
  • Loading branch information
survived committed Nov 6, 2023
1 parent fff255f commit 77acb56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion round-based/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ futures-util = { version = "0.3", default-features = false }
phantom-type = "0.3"
tracing = "0.1"
thiserror = "1"
never = "0.1"

round-based-derive = { path = "../round-based-derive", optional = true }

Expand Down
10 changes: 5 additions & 5 deletions round-based/src/rounds_router/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@

use std::any::Any;
use std::collections::HashMap;
use std::convert::Infallible;
use std::fmt::Debug;
use std::mem;

use futures_util::{Stream, StreamExt};
use never::Never;
use phantom_type::PhantomType;
use thiserror::Error;
use tracing::{debug, error, trace, trace_span, warn, Span};
Expand Down Expand Up @@ -219,11 +219,11 @@ where
errors::Bug::MismatchedOutputType,
)))?),
Ok(Err(any)) => Err(any
.downcast::<CompleteRoundError<R::Error, Never>>()
.downcast::<CompleteRoundError<R::Error, Infallible>>()
.or(Err(CompleteRoundError::from(
errors::Bug::MismatchedErrorType,
)))?
.map_io_err(|e| e.into_any())),
.map_io_err(|e| match e {})),
Err(err) => Err(errors::Bug::TakeRoundResult(err).into()),
}
}
Expand Down Expand Up @@ -331,7 +331,7 @@ enum TakeOutputError {

enum ProcessRoundMessageImpl<S: MessagesStore, M: ProtocolMessage + RoundMessage<S::Msg>> {
InProgress { store: S, _ph: PhantomType<fn(M)> },
Completed(Result<S::Output, CompleteRoundError<S::Error, Never>>),
Completed(Result<S::Output, CompleteRoundError<S::Error, Infallible>>),
Gone,
}

Expand All @@ -343,7 +343,7 @@ where
fn _process_message(
store: &mut S,
msg: Incoming<M>,
) -> Result<(), CompleteRoundError<S::Error, Never>> {
) -> Result<(), CompleteRoundError<S::Error, Infallible>> {
let msg = msg.try_map(M::from_protocol_message).map_err(|msg| {
errors::Bug::MessageFromAnotherRound {
actual_number: msg.round(),
Expand Down

0 comments on commit 77acb56

Please sign in to comment.