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

View file

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

View file

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

View file

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

View file

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