rpc: remove temporary lints for interface

This commit is contained in:
hinto.janai 2024-08-09 16:37:10 -04:00
parent 7784fb2e63
commit c0950f3ba5
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
6 changed files with 7 additions and 30 deletions

View file

@ -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;

View file

@ -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),
}
}
}

View file

@ -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},

View file

@ -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
}

View file

@ -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

View file

@ -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(()))
}