aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rw-r--r--macros/Cargo.toml2
-rw-r--r--macros/src/libs/intertrait_macros/gen_caster.rs2
-rw-r--r--test_util_macros/Cargo.toml11
-rw-r--r--test_util_macros/src/lib.rs47
5 files changed, 2 insertions, 61 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 9bf4a0a..b6dca81 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -60,7 +60,6 @@ tokio = { version = "1.20.1", features = ["macros", "rt-multi-thread", "time"] }
[workspace]
members = [
"macros",
- "test_util_macros",
"examples/with-3rd-party/third-party-lib",
]
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
index 2434028..4028263 100644
--- a/macros/Cargo.toml
+++ b/macros/Cargo.toml
@@ -33,4 +33,4 @@ syrette = { version = "0.4.1", path = ".." }
mockall = "0.11.1"
pretty_assertions = "1.3.0"
syn = { version = "1.0.96", features = ["full", "extra-traits"] }
-test_util_macros = { path = "../test_util_macros" }
+utility-macros = { git = "https://git.hampusmat.com/utility-macros" }
diff --git a/macros/src/libs/intertrait_macros/gen_caster.rs b/macros/src/libs/intertrait_macros/gen_caster.rs
index c2fa226..06f5aad 100644
--- a/macros/src/libs/intertrait_macros/gen_caster.rs
+++ b/macros/src/libs/intertrait_macros/gen_caster.rs
@@ -124,7 +124,7 @@ impl IUuid for Uuid
mod tests
{
use pretty_assertions::assert_eq;
- use test_util_macros::repeat_char;
+ use utility_macros::repeat_char;
use super::*;
diff --git a/test_util_macros/Cargo.toml b/test_util_macros/Cargo.toml
deleted file mode 100644
index 8848961..0000000
--- a/test_util_macros/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "test_util_macros"
-version = "0.1.0"
-edition = "2021"
-
-[lib]
-proc_macro = true
-
-[dependencies]
-syn = { version = "1.0.96", features = ["full"] }
-quote = "1.0.18"
diff --git a/test_util_macros/src/lib.rs b/test_util_macros/src/lib.rs
deleted file mode 100644
index aa87ecf..0000000
--- a/test_util_macros/src/lib.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-#![deny(clippy::all)]
-#![deny(clippy::pedantic)]
-#![deny(missing_docs)]
-
-//! Internal macros used by tests.
-
-use std::iter::repeat;
-
-use proc_macro::TokenStream;
-use quote::quote;
-use syn::parse::Parse;
-use syn::{parse_macro_input, LitChar, LitInt, Token};
-
-/// Repeats a character N number of times.
-#[proc_macro]
-pub fn repeat_char(input: TokenStream) -> TokenStream
-{
- let RepeatMacroArgs { character, count } =
- parse_macro_input!(input as RepeatMacroArgs);
-
- let repeated = repeat(character.value()).take(count).collect::<String>();
-
- quote! {
- #repeated
- }
- .into()
-}
-
-struct RepeatMacroArgs
-{
- character: LitChar,
- count: usize,
-}
-
-impl Parse for RepeatMacroArgs
-{
- fn parse(input: syn::parse::ParseStream) -> syn::Result<Self>
- {
- let character = input.parse::<LitChar>()?;
-
- input.parse::<Token![,]>()?;
-
- let count = input.parse::<LitInt>()?.base10_parse::<usize>()?;
-
- Ok(Self { character, count })
- }
-}