Skip to content

Commit

Permalink
complete implementation of IntoAttributeValue for number types (#3169)
Browse files Browse the repository at this point in the history
  • Loading branch information
chungwong authored Nov 6, 2024
1 parent 2f8f185 commit 3c30a2b
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion packages/core/src/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _)
Expand All @@ -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)
Expand Down

0 comments on commit 3c30a2b

Please sign in to comment.