From 607d8d50b76665b67ca6f3124aa81773bec110b7 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 25 Dec 2023 22:53:13 +0100 Subject: WIP Linkme dependency removal --- macros/src/util/syn_path.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'macros/src/util') diff --git a/macros/src/util/syn_path.rs b/macros/src/util/syn_path.rs index 26e2597..6efea01 100644 --- a/macros/src/util/syn_path.rs +++ b/macros/src/util/syn_path.rs @@ -1,16 +1,26 @@ use std::fmt::Write; use quote::ToTokens; -use syn::punctuated::Pair; +use syn::punctuated::{Pair, Punctuated}; pub trait SynPathExt { + fn new_empty() -> Self; + /// Converts the [`syn::Path`] to a [`String`]. fn to_string(&self) -> String; } impl SynPathExt for syn::Path { + fn new_empty() -> Self + { + Self { + leading_colon: None, + segments: Punctuated::new(), + } + } + fn to_string(&self) -> String { self.segments.pairs().map(Pair::into_tuple).fold( -- cgit v1.2.3-18-g5258