Clippy
This commit is contained in:
parent
2ba158a0d4
commit
0cac6a0094
3 changed files with 16 additions and 13 deletions
|
|
@ -2,6 +2,7 @@ use async_trait::async_trait;
|
|||
use rand::Rng;
|
||||
use rand_pcg::Pcg64;
|
||||
use rand_seeder::Seeder;
|
||||
use std::fmt;
|
||||
use minisql::operation::ColumnSelection;
|
||||
use minisql::restricted_row::RestrictedRow;
|
||||
use minisql::schema::{Column, TableSchema};
|
||||
|
|
@ -20,14 +21,14 @@ pub enum CompleteStatus {
|
|||
CreateIndex,
|
||||
}
|
||||
|
||||
impl CompleteStatus {
|
||||
fn to_string(&self) -> String {
|
||||
impl fmt::Display for CompleteStatus {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
CompleteStatus::Insert { oid, rows } => format!("INSERT {} {}", oid, rows),
|
||||
CompleteStatus::Delete(rows) => format!("DELETE {}", rows),
|
||||
CompleteStatus::Select(rows) => format!("SELECT {}", rows),
|
||||
CompleteStatus::CreateTable => "CREATE TABLE".to_string(),
|
||||
CompleteStatus::CreateIndex => "CREATE INDEX".to_string(),
|
||||
CompleteStatus::Insert { oid, rows } => write!(f, "INSERT {} {}", oid, rows),
|
||||
CompleteStatus::Delete(rows) => write!(f, "DELETE {}", rows),
|
||||
CompleteStatus::Select(rows) => write!(f, "SELECT {}", rows),
|
||||
CompleteStatus::CreateTable => write!(f, "CREATE TABLE"),
|
||||
CompleteStatus::CreateIndex => write!(f, "CREATE INDEX"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -118,4 +119,4 @@ fn column_to_description(schema: &TableSchema, column: Column) -> anyhow::Result
|
|||
fn table_name_to_oid(table_name: &str) -> i32 {
|
||||
let mut rng: Pcg64 = Seeder::from(table_name).make_rng();
|
||||
rng.gen::<i32>()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue