Skip to content

impl From<[T; N]> for Value #1214

@photino

Description

@photino

We have impl From<&[T]> for Value and impl From<Vec<T>> for Value, why don't we support the conversion from an array?

impl<T: Into<Value>, const N: usize> From<[T; N]> for Value {
    fn from(array: [T; N]) -> Self {
        let vec = array.into_iter().map(|v| v.into()).collect();
        Self::Array(vec)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions