Skip to content

Commit

Permalink
fix: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Feb 17, 2024
1 parent 78e1af6 commit 8d79bbd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl ClientSession {
pub async fn handle(&mut self) -> Result<Message, ()> {
match self.conn.read().await.unwrap() {
Some(message) => Ok(message),
None => Err(())
None => Err(()),
}
}

Expand Down
23 changes: 11 additions & 12 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
}
}
Expand All @@ -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!(""),
}
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 8d79bbd

Please sign in to comment.