From f2def401ba0b2b5aa4092b7167cd334d5bd54cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sat, 19 Nov 2022 22:07:59 +0300 Subject: [PATCH] refactor(deps): utilize workspace dependencies https://doc.rust-lang.org/stable/cargo/reference/workspaces.html#the-workspacedependencies-table --- Cargo.lock | 2 ++ Cargo.toml | 4 ++++ git-cliff-core/Cargo.toml | 4 ++-- git-cliff-core/src/lib.rs | 5 ----- git-cliff/Cargo.toml | 2 ++ git-cliff/src/args.rs | 2 +- git-cliff/src/changelog.rs | 2 +- 7 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5bb648f9e..ec24506478 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -431,9 +431,11 @@ dependencies = [ "clap_mangen", "dirs-next", "git-cliff-core", + "glob", "log", "pretty_assertions", "pretty_env_logger", + "regex", "update-informer", ] diff --git a/Cargo.toml b/Cargo.toml index 42a1cce991..4836edf62b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,10 @@ members = [ "git-cliff", ] +[workspace.dependencies] +regex = "1.6.0" +glob = "0.3.0" + [profile.dev] opt-level = 0 debug = true diff --git a/git-cliff-core/Cargo.toml b/git-cliff-core/Cargo.toml index c4de1d19e9..ebda7e862a 100644 --- a/git-cliff-core/Cargo.toml +++ b/git-cliff-core/Cargo.toml @@ -11,15 +11,15 @@ edition = "2021" rust-version = "1.60.0" [dependencies] +glob.workspace = true +regex.workspace = true thiserror = "1.0.35" serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.85" tera = "1.17.1" -regex = "1.6.0" serde_regex = "1.1.0" indexmap = "1.9.1" toml = "0.5.9" -glob = "0.3.0" lazy-regex = "2.3.0" [dependencies.git2] diff --git a/git-cliff-core/src/lib.rs b/git-cliff-core/src/lib.rs index 6d9905afc1..7672bddc7d 100644 --- a/git-cliff-core/src/lib.rs +++ b/git-cliff-core/src/lib.rs @@ -1,11 +1,6 @@ //! A highly customizable changelog generator #![warn(missing_docs, clippy::unwrap_used)] -/// Export `glob` crate. -pub use glob; -/// Export `regex` crate. -pub use regex; - /// Command runner. pub mod command; /// Git commit. diff --git a/git-cliff/Cargo.toml b/git-cliff/Cargo.toml index 58177ea72c..570caa1322 100644 --- a/git-cliff/Cargo.toml +++ b/git-cliff/Cargo.toml @@ -26,6 +26,8 @@ path = "src/bin/mangen.rs" default = ["update-informer"] [dependencies] +glob.workspace = true +regex.workspace = true pretty_env_logger = "0.4.0" log = "0.4.17" dirs-next = "2.0.0" diff --git a/git-cliff/src/args.rs b/git-cliff/src/args.rs index 62c3192c7a..73cdd77c71 100644 --- a/git-cliff/src/args.rs +++ b/git-cliff/src/args.rs @@ -3,8 +3,8 @@ use clap::{ ArgEnum, Parser, }; -use git_cliff_core::glob::Pattern; use git_cliff_core::DEFAULT_CONFIG; +use glob::Pattern; use std::path::PathBuf; #[derive(Debug, Clone, Copy, ArgEnum)] diff --git a/git-cliff/src/changelog.rs b/git-cliff/src/changelog.rs index 9b0cce6850..dce9780e4c 100644 --- a/git-cliff/src/changelog.rs +++ b/git-cliff/src/changelog.rs @@ -182,8 +182,8 @@ mod test { CommitPreprocessor, GitConfig, }; - use git_cliff_core::regex::Regex; use pretty_assertions::assert_eq; + use regex::Regex; use std::str; fn get_test_data() -> (Config, Vec>) {