types: drop unchecked construction from validated newtypes

Lewis: May this revision serve well! <lu5a@proton.me>
This commit is contained in:
Lewis
2026-07-25 08:27:40 +03:00
committed by Tangled
parent b6274bb3c4
commit 25d7d24d4e
+12 -6
View File
@@ -42,12 +42,6 @@ macro_rules! impl_string_common {
}
}
impl From<String> for $name {
fn from(s: String) -> Self {
Self(s)
}
}
impl<'a> From<&'a $name> for Cow<'a, str> {
fn from(val: &'a $name) -> Self {
Cow::Borrowed(&val.0)
@@ -109,6 +103,12 @@ macro_rules! simple_string_newtype {
}
}
impl From<String> for $name {
fn from(s: String) -> Self {
Self(s)
}
}
impl_string_common!($name);
};
}
@@ -129,6 +129,12 @@ macro_rules! simple_string_newtype_no_sqlx {
}
}
impl From<String> for $name {
fn from(s: String) -> Self {
Self(s)
}
}
impl_string_common!($name);
};
}