mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-11-16 15:58:14 +00:00
rpc: remove temporary lints for interface
This commit is contained in:
parent
7784fb2e63
commit
c0950f3ba5
6 changed files with 7 additions and 30 deletions
|
@ -76,21 +76,12 @@
|
|||
// TODO
|
||||
rustdoc::bare_urls,
|
||||
|
||||
clippy::multiple_crate_versions,
|
||||
clippy::module_name_repetitions,
|
||||
clippy::module_inception,
|
||||
clippy::redundant_pub_crate,
|
||||
clippy::option_if_let_else,
|
||||
)]
|
||||
// Allow some lints when running in debug mode.
|
||||
#![cfg_attr(
|
||||
debug_assertions,
|
||||
allow(
|
||||
clippy::todo,
|
||||
clippy::multiple_crate_versions,
|
||||
unused_imports,
|
||||
unused_variables
|
||||
)
|
||||
)]
|
||||
// Allow some lints in tests.
|
||||
#![cfg_attr(
|
||||
test,
|
||||
|
@ -101,8 +92,6 @@
|
|||
clippy::too_many_lines
|
||||
)
|
||||
)]
|
||||
// TODO: remove me after finishing impl
|
||||
#![allow(dead_code, unreachable_code, clippy::diverging_sub_expression)]
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Mod
|
||||
mod route;
|
||||
|
|
|
@ -81,7 +81,7 @@ macro_rules! generate_endpoints_inner {
|
|||
// Serialize to bytes and respond.
|
||||
match cuprate_epee_encoding::to_bytes(response) {
|
||||
Ok(bytes) => Ok(bytes.freeze()),
|
||||
Err(e) => Err(StatusCode::INTERNAL_SERVER_ERROR),
|
||||
Err(_) => Err(StatusCode::INTERNAL_SERVER_ERROR),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
//! Free functions.
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Use
|
||||
use axum::{
|
||||
routing::{method_routing::get, post},
|
||||
Router,
|
||||
};
|
||||
use axum::Router;
|
||||
|
||||
use crate::{
|
||||
route::{bin, fallback, json_rpc, other},
|
||||
|
|
|
@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize};
|
|||
pub enum RpcError {}
|
||||
|
||||
impl From<RpcError> for StatusCode {
|
||||
fn from(value: RpcError) -> Self {
|
||||
fn from(_: RpcError) -> Self {
|
||||
// TODO
|
||||
Self::INTERNAL_SERVER_ERROR
|
||||
}
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
//! RPC handler trait.
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Use
|
||||
use std::{future::Future, task::Poll};
|
||||
use std::future::Future;
|
||||
|
||||
use axum::{http::StatusCode, response::IntoResponse};
|
||||
use futures::{channel::oneshot::channel, FutureExt};
|
||||
use tower::Service;
|
||||
|
||||
use cuprate_helper::asynch::InfallibleOneshotReceiver;
|
||||
use cuprate_json_rpc::Id;
|
||||
use cuprate_rpc_types::json::JsonRpcRequest;
|
||||
|
||||
use crate::{rpc_error::RpcError, rpc_request::RpcRequest, rpc_response::RpcResponse};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- RpcHandler
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
//---------------------------------------------------------------------------------------------------- Use
|
||||
use std::task::Poll;
|
||||
|
||||
use futures::{channel::oneshot::channel, FutureExt};
|
||||
use futures::channel::oneshot::channel;
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tower::Service;
|
||||
|
||||
use cuprate_helper::asynch::InfallibleOneshotReceiver;
|
||||
use cuprate_json_rpc::Id;
|
||||
use cuprate_rpc_types::json::JsonRpcRequest;
|
||||
|
||||
use crate::{
|
||||
rpc_error::RpcError, rpc_handler::RpcHandler, rpc_request::RpcRequest,
|
||||
|
@ -48,7 +47,7 @@ impl Service<RpcRequest> for RpcHandlerDummy {
|
|||
type Error = RpcError;
|
||||
type Future = InfallibleOneshotReceiver<Result<RpcResponse, RpcError>>;
|
||||
|
||||
fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
fn poll_ready(&mut self, _: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
Poll::Ready(Ok(()))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue