cleanup rust warnings

This commit is contained in:
Samuel Lorch 2023-10-30 22:19:55 +01:00
parent 4c564164e8
commit 77e2430507
5 changed files with 4 additions and 14 deletions

View file

@ -29,9 +29,6 @@ use tracing::info;
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum ApiError { pub enum ApiError {
#[error("Not Implemented")]
NotImplemented,
#[error("Not Found")] #[error("Not Found")]
NotFound, NotFound,
@ -50,8 +47,6 @@ impl Into<ErrorObject<'static>> for ApiError {
info!("Converting Error {:?}", self); info!("Converting Error {:?}", self);
match self { match self {
// Todo Add Proper mappings // Todo Add Proper mappings
// ApiError::ParameterDeserialize => ErrorCode::InvalidParams,
ApiError::NotImplemented => ErrorCode::ServerError(0),
_ => ErrorCode::InternalError, _ => ErrorCode::InternalError,
} }
.into() .into()

View file

@ -37,7 +37,6 @@ pub struct ConfigManager {
} }
pub struct ConfigTransaction<'a> { pub struct ConfigTransaction<'a> {
finished: bool,
shared_data: MutexGuard<'a, SharedData>, shared_data: MutexGuard<'a, SharedData>,
pub config: Config, pub config: Config,
} }
@ -114,7 +113,6 @@ impl ConfigManager {
let data = self.shared_data.lock().unwrap(); let data = self.shared_data.lock().unwrap();
ConfigTransaction { ConfigTransaction {
finished: false,
config: data.pending_config.clone(), config: data.pending_config.clone(),
shared_data: data, shared_data: data,
} }
@ -131,7 +129,7 @@ impl<'a> ConfigTransaction<'a> {
Ok(()) Ok(())
} }
pub fn revert(mut self) {} pub fn revert(self) {}
} }
fn read_file_to_config(path: &str) -> Result<Config, ConfigError> { fn read_file_to_config(path: &str) -> Result<Config, ConfigError> {

View file

@ -1,4 +1,4 @@
#![allow(dead_code)] // #![allow(dead_code)]
use std::{ use std::{
collections::HashMap, collections::HashMap,

View file

@ -1,6 +1,5 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::error::Error;
use std::hash::Hash;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use uuid::Uuid; use uuid::Uuid;
@ -11,10 +10,9 @@ use serde::Deserialize;
use tower_cookies::{Cookie, Cookies}; use tower_cookies::{Cookie, Cookies};
use axum::{ use axum::{
extract::Extension,
extract::State, extract::State,
http::{Request, StatusCode}, http::{Request, StatusCode},
middleware::{self, Next}, middleware::Next,
response::{IntoResponse, Response}, response::{IntoResponse, Response},
}; };

View file

@ -1,5 +1,4 @@
use crate::AppState; use crate::AppState;
use anyhow::Context;
use axum::routing::post; use axum::routing::post;
use axum::{Json, Router}; use axum::{Json, Router};
use jsonrpsee::core::traits::ToRpcParams; use jsonrpsee::core::traits::ToRpcParams;