Skip to content

Commit

Permalink
Remove const_new for String (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjhongwu authored Sep 7, 2024
1 parent 308db09 commit 17589c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions strong-type-derive/src/detail/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions strong-type-derive/src/detail/basic_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 17589c8

Please sign in to comment.