Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert(abci): remove RefUniwndSafe trait from RequestDispatcher #19

Merged
merged 1 commit into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions abci/src/application.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! ABCI application interface.
use std::panic::RefUnwindSafe;

use tracing::debug;

Expand Down Expand Up @@ -139,7 +138,7 @@ pub trait Application {
}
}

pub trait RequestDispatcher: RefUnwindSafe {
pub trait RequestDispatcher {
/// Executes the relevant application method based on the type of the
/// request, and produces the corresponding response.
///
Expand All @@ -149,7 +148,7 @@ pub trait RequestDispatcher: RefUnwindSafe {
}

// Implement `RequestDispatcher` for all `Application`s.
impl<A: Application + RefUnwindSafe> RequestDispatcher for A {
impl<A: Application> RequestDispatcher for A {
fn handle(&self, request: abci::Request) -> Option<abci::Response> {
tracing::trace!(?request, "received request");

Expand Down
3 changes: 1 addition & 2 deletions abci/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mod unix;
use std::{
io::{Read, Write},
net::{IpAddr, SocketAddr, SocketAddrV4, SocketAddrV6},
panic::RefUnwindSafe,
str::FromStr,
};

Expand All @@ -24,7 +23,7 @@ pub(crate) const DEFAULT_SERVER_READ_BUF_SIZE: usize = 1024 * 1024;
/// Use [`Server::handle_connection()`] to accept connection and process all
/// traffic in this connection. Each incoming connection will be processed using
/// `app`.
pub trait Server: RefUnwindSafe {
pub trait Server {
/// Process one incoming connection.
///
/// Returns when the connection is terminated or RequestDispatcher returns
Expand Down