From 8d79bbd0d9cda8998cd68f527d309f74546d4f33 Mon Sep 17 00:00:00 2001 From: Vedat Can Keklik Date: Sat, 17 Feb 2024 17:14:02 +0300 Subject: [PATCH] fix: Lint --- cli/src/lib.rs | 2 +- cli/src/main.rs | 23 +++++++++++------------ server/src/net/mod.rs | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 5635934..dfee744 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -15,7 +15,7 @@ impl ClientSession { pub async fn handle(&mut self) -> Result { match self.conn.read().await.unwrap() { Some(message) => Ok(message), - None => Err(()) + None => Err(()), } } diff --git a/cli/src/main.rs b/cli/src/main.rs index 30225c0..44dd1a8 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -4,7 +4,10 @@ use std::{ }; use clap::Parser; -use lykiadb_server::{net::{Message, Request, Response}, runtime::error::report_error}; +use lykiadb_server::{ + net::{Message, Request, Response}, + runtime::error::report_error, +}; use lykiadb_shell::ClientSession; use tokio::net::TcpStream; @@ -38,13 +41,11 @@ async fn run_repl() { let response = session.handle().await.unwrap(); match response { - Message::Response(Response::Value(result)) - => println!("{result}"), - Message::Response(Response::Error(err)) - => report_error("prompt", &line, err.clone()), - _ => panic!("") + Message::Response(Response::Value(result)) => println!("{result}"), + Message::Response(Response::Error(err)) => report_error("prompt", &line, err.clone()), + _ => panic!(""), } - + line.clear(); } } @@ -71,11 +72,9 @@ async fn run_file(filename: &str, print_ast: bool) { let response = session.handle().await.unwrap(); match response { - Message::Response(Response::Value(result)) - => println!("{result}"), - Message::Response(Response::Error(err)) - => report_error(filename, &content, err.clone()), - _ => panic!("") + Message::Response(Response::Value(result)) => println!("{result}"), + Message::Response(Response::Error(err)) => report_error(filename, &content, err.clone()), + _ => panic!(""), } } diff --git a/server/src/net/mod.rs b/server/src/net/mod.rs index 0e8fd4f..9412b45 100644 --- a/server/src/net/mod.rs +++ b/server/src/net/mod.rs @@ -17,7 +17,7 @@ pub enum Request { #[derive(Debug, Clone, Serialize, Deserialize)] pub enum Response { Value(Bson), - Error(ExecutionError) + Error(ExecutionError), } #[derive(Debug, Clone, Serialize, Deserialize)]