chore: cleanup todos and unused parameter

This commit is contained in:
Jindřich Moravec 2024-02-05 23:50:25 +01:00
parent d36d3300d0
commit 25824d78f9
4 changed files with 2 additions and 21 deletions

View file

@ -128,7 +128,6 @@ impl State {
} }
async fn attach_table(&mut self, table: Table) { async fn attach_table(&mut self, table: Table) {
// TODO: You need to update the global DB SCHEMA!
let new_table_position: TablePosition = self.tables.len(); let new_table_position: TablePosition = self.tables.len();
self.table_name_position_mapping self.table_name_position_mapping
.insert(table.schema().table_name().clone(), new_table_position); .insert(table.schema().table_name().clone(), new_table_position);

View file

@ -2,8 +2,6 @@ use crate::error::TypeConversionError;
use proto::message::primitive::pgoid::PgOid; use proto::message::primitive::pgoid::PgOid;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::cmp::Ordering; use std::cmp::Ordering;
// TODO: Private???
// use bincode::{Encode, Encoder, EncodeError, Decode, Decoder, DecodeError};
use bincode::{Encode, Decode}; use bincode::{Encode, Decode};
// ==============Types================ // ==============Types================
@ -92,7 +90,6 @@ impl PartialOrd for Value {
} }
} }
// TODO: Make column know about indexable types
impl Ord for Value { impl Ord for Value {
fn cmp(&self, other: &Self) -> Ordering { fn cmp(&self, other: &Self) -> Ordering {
match (self, other) { match (self, other) {
@ -120,18 +117,6 @@ impl Ord for Value {
} }
} }
// impl Encode for Value {
// fn encode<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError> {
// todo!()
// }
// }
// impl Decode for Value {
// fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, DecodeError> {
// todo!()
// }
// }
impl DbType { impl DbType {
fn new_n_option(n: usize, inside: DbType) -> DbType { fn new_n_option(n: usize, inside: DbType) -> DbType {
if n == 0 { if n == 0 {

View file

@ -85,7 +85,7 @@ async fn handle_stream(
let mut wrapped_writer = ServerProtoWrapper::new(writer, config.get_throttle()); let mut wrapped_writer = ServerProtoWrapper::new(writer, config.get_throttle());
let result = match request { let result = match request {
Ok(req) => { Ok(req) => {
handle_connection(&mut reader, &mut wrapped_writer, req, state, token, config).await handle_connection(&mut reader, &mut wrapped_writer, req, state, token).await
} }
Err(ServerHandshakeError::IsCancelRequest(cancel)) => { Err(ServerHandshakeError::IsCancelRequest(cancel)) => {
handle_cancellation(cancel.pid, cancel.secret, &tokens).await handle_cancellation(cancel.pid, cancel.secret, &tokens).await
@ -141,7 +141,6 @@ async fn handle_connection<R, W>(
request: HandshakeRequest, request: HandshakeRequest,
state: SharedDbState, state: SharedDbState,
token: ResetCancelToken, token: ResetCancelToken,
config: Arc<Configuration>,
) -> anyhow::Result<()> ) -> anyhow::Result<()>
where where
R: FrontendProtoReader + Send, R: FrontendProtoReader + Send,
@ -157,7 +156,7 @@ where
break; break;
} }
FrontendMessage::Query(data) => { FrontendMessage::Query(data) => {
let result = handle_query(writer, &state, data.query.into(), &token, &config).await; let result = handle_query(writer, &state, data.query.into(), &token).await;
match result { match result {
Ok(_) => {} Ok(_) => {}
Err(e) => writer.write_error_message(&e.to_string()).await?, Err(e) => writer.write_error_message(&e.to_string()).await?,
@ -176,7 +175,6 @@ async fn handle_query<W>(
state: &SharedDbState, state: &SharedDbState,
query: String, query: String,
token: &ResetCancelToken, token: &ResetCancelToken,
config: &Arc<Configuration>,
) -> anyhow::Result<()> ) -> anyhow::Result<()>
where where
W: BackendProtoWriter + ProtoFlush + Send, W: BackendProtoWriter + ProtoFlush + Send,

View file

@ -16,7 +16,6 @@ pub type Result<T> = std::result::Result<T, Error>;
pub type Column = u64; pub type Column = u64;
pub type FilePosition = u64; pub type FilePosition = u64;
// TODO: Consider adding another type parameter for indexable values
#[derive(Debug)] #[derive(Debug)]
pub struct Store<T> { pub struct Store<T> {
pub header: StoreHeader, pub header: StoreHeader,