Skip to content

Commit

Permalink
Remove slugify
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <deniallugo@gmail.com>
  • Loading branch information
Deniallugo committed May 23, 2024
1 parent 8f5a2d7 commit 1317bdf
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 38 deletions.
26 changes: 0 additions & 26 deletions zk_toolbox/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion zk_toolbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ toml = "0.8.12"
url = { version = "2.5.0", features = ["serde"] }
xshell = "0.2.6"
futures = "0.3.30"
slugify-rs = "0.0.3"
thiserror = "1.0.57"
2 changes: 2 additions & 0 deletions zk_toolbox/crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ pub mod files;
pub mod forge;
mod prerequisites;
mod prompt;
mod slugify;
mod term;
pub mod wallets;

pub use prerequisites::check_prerequisites;
pub use prompt::{init_prompt_theme, Prompt, PromptConfirm, PromptSelect};
pub use slugify::slugify;
pub use term::{logger, spinner};
3 changes: 3 additions & 0 deletions zk_toolbox/crates/common/src/slugify.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub fn slugify(data: &str) -> String {
data.trim().replace(" ", "-")
}
1 change: 0 additions & 1 deletion zk_toolbox/crates/zk_inception/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ strum_macros.workspace = true
strum.workspace = true
toml.workspace = true
url.workspace = true
slugify-rs.workspace = true
thiserror.workspace = true
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::{path::PathBuf, str::FromStr};

use clap::Parser;
use common::{Prompt, PromptConfirm, PromptSelect};
use common::{slugify, Prompt, PromptConfirm, PromptSelect};
use ethers::types::H160;
use serde::{Deserialize, Serialize};
use slugify_rs::slugify;
use strum::IntoEnumIterator;
use strum_macros::{Display, EnumIter};

Expand Down Expand Up @@ -43,7 +42,7 @@ impl ChainCreateArgs {
let mut chain_name = self
.chain_name
.unwrap_or_else(|| Prompt::new("How do you want to name the chain?").ask());
chain_name = slugify!(&chain_name);
chain_name = slugify(&chain_name);

let chain_id = self.chain_id.unwrap_or_else(|| {
Prompt::new("What's the chain id?")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use clap::Parser;
use common::Prompt;
use common::{slugify, Prompt};
use serde::{Deserialize, Serialize};
use slugify_rs::slugify;
use url::Url;

use crate::{
Expand Down Expand Up @@ -48,7 +47,7 @@ impl GenesisArgs {
.default(DATABASE_SERVER_URL)
.ask()
});
let server_db_name = slugify!(&self.server_db_name.unwrap_or_else(|| {
let server_db_name = slugify(&self.server_db_name.unwrap_or_else(|| {
Prompt::new(&format!(
"Please provide server database name for chain {chain_name}"
))
Expand All @@ -62,7 +61,7 @@ impl GenesisArgs {
.default(DATABASE_PROVER_URL)
.ask()
});
let prover_db_name = slugify!(&self.prover_db_name.unwrap_or_else(|| {
let prover_db_name = slugify(&self.prover_db_name.unwrap_or_else(|| {
Prompt::new(&format!(
"Please provide prover database name for chain {chain_name}"
))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use std::path::PathBuf;

use clap::Parser;
use common::{Prompt, PromptConfirm, PromptSelect};
use common::{slugify, Prompt, PromptConfirm, PromptSelect};
use serde::{Deserialize, Serialize};
use slugify_rs::slugify;
use strum::IntoEnumIterator;
use strum_macros::{Display, EnumIter};
use url::Url;
Expand Down Expand Up @@ -37,7 +36,7 @@ impl EcosystemCreateArgs {
let mut ecosystem_name = self
.ecosystem_name
.unwrap_or_else(|| Prompt::new("How do you want to name the ecosystem?").ask());
ecosystem_name = slugify!(&ecosystem_name);
ecosystem_name = slugify(&ecosystem_name);

let link_to_code = self.link_to_code.unwrap_or_else(|| {
let link_to_code_selection = PromptSelect::new(
Expand Down

0 comments on commit 1317bdf

Please sign in to comment.