complete implementation of IntoAttributeValue for number types (#3169)

This commit is contained in:
Chung 2024-11-07 05:30:12 +11:00 committed by GitHub
parent 2f8f185930
commit 3c30a2bffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1036,6 +1036,16 @@ impl IntoAttributeValue for f64 {
}
}
impl IntoAttributeValue for i8 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for i16 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for i32 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
@ -1046,13 +1056,48 @@ impl IntoAttributeValue for i64 {
AttributeValue::Int(self)
}
}
impl IntoAttributeValue for isize {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for i128 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for u8 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for u16 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for u32 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for u64 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for usize {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for u128 {
fn into_value(self) -> AttributeValue {
AttributeValue::Int(self as _)
}
}
impl IntoAttributeValue for bool {
fn into_value(self) -> AttributeValue {
AttributeValue::Bool(self)