Impl new_from for wrapper types

This commit is contained in:
Omar Abdulla
2025-07-17 15:33:28 +03:00
parent 2ef6f7ba63
commit 84ab873b46
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -52,6 +52,10 @@ macro_rules! define_wrapper_type {
Self(value)
}
pub fn new_from<T: Into<$ty>>(value: T) -> Self {
Self(value.into())
}
pub fn into_inner(self) -> $ty {
self.0
}