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 {}