From 17589c803d6aa1f6fffa2dc25f4b9f374e03001c Mon Sep 17 00:00:00 2001 From: Yun-Jhong Wu Date: Fri, 6 Sep 2024 19:21:14 -0500 Subject: [PATCH] Remove const_new for String (#73) --- strong-type-derive/src/detail/basic.rs | 4 ---- strong-type-derive/src/detail/basic_primitive.rs | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/strong-type-derive/src/detail/basic.rs b/strong-type-derive/src/detail/basic.rs index 8c39757..e6a5ec6 100644 --- a/strong-type-derive/src/detail/basic.rs +++ b/strong-type-derive/src/detail/basic.rs @@ -11,10 +11,6 @@ pub(crate) fn implement_basic( pub fn new(value: impl Into<#value_type>) -> Self { Self(value.into()) } - - pub const fn const_new(value: #value_type) -> Self { - Self(value) - } } impl StrongType for #name { diff --git a/strong-type-derive/src/detail/basic_primitive.rs b/strong-type-derive/src/detail/basic_primitive.rs index 01832db..99182ab 100644 --- a/strong-type-derive/src/detail/basic_primitive.rs +++ b/strong-type-derive/src/detail/basic_primitive.rs @@ -7,6 +7,10 @@ pub(crate) fn implement_basic_primitive(name: &syn::Ident, value_type: &syn::Ide pub fn value(&self) -> #value_type { self.0 } + + pub const fn const_new(value: #value_type) -> Self { + Self(value) + } } impl Copy for #name {}