Merge pull request #1651 from ealmloff/string-into-attribute

Add into attribute value impl for String
This commit is contained in:
Jonathan Kelley 2023-12-06 21:14:31 -08:00 committed by GitHub
commit 850f2da0c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -791,6 +791,12 @@ impl<'a> IntoAttributeValue<'a> for &'a str {
}
}
impl<'a> IntoAttributeValue<'a> for String {
fn into_value(self, cx: &'a Bump) -> AttributeValue<'a> {
AttributeValue::Text(cx.alloc_str(&self))
}
}
impl<'a> IntoAttributeValue<'a> for f64 {
fn into_value(self, _: &'a Bump) -> AttributeValue<'a> {
AttributeValue::Float(self)