Skip to content

Commit

Permalink
Replace custom crate with 3rd party (#39)
Browse files Browse the repository at this point in the history
* Replace custom crate with 3rd party

* Fix Cargo.toml and missing comment
  • Loading branch information
gillchristian authored May 7, 2024
1 parent 14eafe6 commit 0a4cac8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 51 deletions.
7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
workspace = { members = ["enum_variants"] }

[package]
name = "rustdis"
version = "0.1.0"
Expand All @@ -17,9 +15,10 @@ futures = "0.3.30"
glob-match = "0.2.1"
thiserror = "1.0.53"
# TODO: Use only required features.
tokio = { version = "1.35.0", features = ['full'] }
tokio = { version = "1.35.0", features = ["full"] }
tokio-util = { version = "0.7.10", features = ["codec"] }
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
uuid = { version = "1.8.0", features = ["v4"] }
enum_variants = { path = "./enum_variants" }
strum = "0.26.2"
strum_macros = "0.26.2"
12 changes: 0 additions & 12 deletions enum_variants/Cargo.toml

This file was deleted.

32 changes: 0 additions & 32 deletions enum_variants/src/lib.rs

This file was deleted.

4 changes: 3 additions & 1 deletion src/commands/command.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::sync::{Arc, Mutex};

use strum::VariantNames;

use crate::commands::executable::Executable;
use crate::commands::{Command as RootCommand, CommandParser, CommandParserError};
use crate::frame::Frame;
Expand Down Expand Up @@ -55,7 +57,7 @@ pub struct Root;
impl Executable for Root {
fn exec(self, _store: Arc<Mutex<Store>>) -> Result<Frame, Error> {
// TODO: list subcommands
let cmds = RootCommand::all_variants()
let cmds = RootCommand::VARIANTS
.iter()
.map(|s| Frame::Simple(s.to_uppercase().to_string()))
.collect();
Expand Down
3 changes: 1 addition & 2 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ pub mod type_;
use bytes::Bytes;
use std::sync::{Arc, Mutex};
use std::{str, vec};
use strum_macros::VariantNames;
use thiserror::Error as ThisError;

use enum_variants::VariantNames;

use crate::commands::executable::Executable;
use crate::frame::Frame;
use crate::store::Store;
Expand Down

0 comments on commit 0a4cac8

Please sign in to comment.