diff --git a/Cargo.lock b/Cargo.lock index f986f4a5..b36f365b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1054,7 +1054,6 @@ dependencies = [ "ignore", "json_comments", "log", - "once_cell", "process_control", "regex", "schemars", diff --git a/Cargo.toml b/Cargo.toml index a1523b0a..d6abc7d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ ignore = "0.4.23" json_comments = "0.2.2" log = "0.4.25" mdsf = { path = "./mdsf", features = ["json-schema"] } -once_cell = "1.20.2" process_control = { version = "5.0.0" } regex = "1.11.1" reqwest = { version = "0.12.12", default-features = false, features = [ diff --git a/codegen/src/tools.rs b/codegen/src/tools.rs index d94b62c7..e2aac632 100644 --- a/codegen/src/tools.rs +++ b/codegen/src/tools.rs @@ -168,10 +168,7 @@ impl Tool { if cmd.is_empty() { String::new() } else { - format!( - "_{}", - cmd.replace('.', "_").replace(":", "_").to_case(Case::Snake) - ) + format!("_{}", cmd.replace(['.', ':'], "_").to_case(Case::Snake)) } ) } @@ -234,17 +231,17 @@ impl Tool { { if self.packages.npm.is_some() { command_types.push(format!("CommandType::NodeModules(\"{}\")", self.binary)); - }; + } if let Some(php) = &self.packages.composer { command_types.push(format!("CommandType::PhpVendor(\"{}\")", php.binary)); - }; + } command_types.push(format!("CommandType::Direct(\"{}\")", self.binary)); if let Some(npm) = &self.packages.npm { command_types.push(format!("CommandType::Npm(\"{npm}\")")); - }; + } }; // TODO: generate if statements instead of array diff --git a/mdsf-vscode/.gitignore b/mdsf-vscode/.gitignore index de4d1f00..0658d1c2 100644 --- a/mdsf-vscode/.gitignore +++ b/mdsf-vscode/.gitignore @@ -1,2 +1,3 @@ dist node_modules +out diff --git a/mdsf/Cargo.toml b/mdsf/Cargo.toml index 8277edef..b654e0d5 100644 --- a/mdsf/Cargo.toml +++ b/mdsf/Cargo.toml @@ -38,7 +38,6 @@ env_logger = { workspace = true } ignore = { workspace = true } json_comments = { workspace = true } log = { workspace = true } -once_cell = { workspace = true } process_control = { workspace = true } regex = { workspace = true } schemars = { workspace = true, optional = true } diff --git a/mdsf/src/commands/completions.rs b/mdsf/src/commands/completions.rs index caebe4ce..0a343431 100644 --- a/mdsf/src/commands/completions.rs +++ b/mdsf/src/commands/completions.rs @@ -49,5 +49,5 @@ pub fn run(args: &CompletionsCommandArguments) { cmd_name, &mut std::io::stdout(), ), - }; + } } diff --git a/mdsf/src/parser/mod.rs b/mdsf/src/parser/mod.rs index 9ed9728e..29fa5956 100644 --- a/mdsf/src/parser/mod.rs +++ b/mdsf/src/parser/mod.rs @@ -1,6 +1,5 @@ use core::{iter::Enumerate, str::Lines}; -use once_cell::sync::Lazy; use regex::Regex; use crate::GO_TEMPORARY_PACKAGE_NAME; @@ -41,7 +40,8 @@ pub fn parse_go_codeblock(lines: &mut Enumerate) -> (bool, String, usize) } // TODO: check for multiline comments -pub static GO_PACKAGE_RE: Lazy = Lazy::new(|| Regex::new(r"^\s*package\s+\w").unwrap()); +pub static GO_PACKAGE_RE: std::sync::LazyLock = + std::sync::LazyLock::new(|| Regex::new(r"^\s*package\s+\w").unwrap()); #[cfg(test)] mod test_go_package_re {