From b1c80f40715a640b15d5cf324aa74d096acf334b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 30 Aug 2025 10:04:58 +0200 Subject: [PATCH] jid: use "jid" instead of "::jid" in quote support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This causes issues in crates using it because they need to have "jid" listed as a direct dependency when it's not always obvious (version mismatch etc. when something already uses jid as a dep) Signed-off-by: Maxime “pep” Buquet --- jid/CHANGELOG.md | 7 +++++++ jid/src/lib.rs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/jid/CHANGELOG.md b/jid/CHANGELOG.md index 180dd8c2f6a68001bbc2881c789487653d6c1818..a4eb336b74ad8f04b6cebd4f5427e7592375e375 100644 --- a/jid/CHANGELOG.md +++ b/jid/CHANGELOG.md @@ -1,3 +1,10 @@ +Version NEXT: + * Changes: + - The 'quote' feature now uses `jid::Jid` instead of `::jid::Jid` to + stop requiring importing the module as a dependency of the project. The + `jid` module just needs to be made available, for example: `use + foo::jid;` + Version 0.12.0, release 2025-01-25: * Breaking: - domainparts are now checked much more in-depth, using the idna crate for diff --git a/jid/src/lib.rs b/jid/src/lib.rs index 0aca6558b95cb8969db4dcc12f4deaca01cfd30c..6cce1fa567e6dfaea706fbdb93e9fea71b807c71 100644 --- a/jid/src/lib.rs +++ b/jid/src/lib.rs @@ -688,7 +688,7 @@ impl ToTokens for Jid { fn to_tokens(&self, tokens: &mut TokenStream) { let s = &self.normalized; tokens.extend(quote! { - ::jid::Jid::new(#s).unwrap() + jid::Jid::new(#s).unwrap() }); } } @@ -698,7 +698,7 @@ impl ToTokens for FullJid { fn to_tokens(&self, tokens: &mut TokenStream) { let s = &self.inner.normalized; tokens.extend(quote! { - ::jid::FullJid::new(#s).unwrap() + jid::FullJid::new(#s).unwrap() }); } } @@ -708,7 +708,7 @@ impl ToTokens for BareJid { fn to_tokens(&self, tokens: &mut TokenStream) { let s = &self.inner.normalized; tokens.extend(quote! { - ::jid::BareJid::new(#s).unwrap() + jid::BareJid::new(#s).unwrap() }); } }