Skip to content

Commit 2b8637a

Browse files
committed
Add From<&[i64]> and From<&[u64]> for Shape
1 parent f77723a commit 2b8637a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,18 @@ impl From<Option<Vec<Option<i64>>>> for Shape {
14201420
}
14211421
}
14221422

1423+
impl From<&[i64]> for Shape {
1424+
fn from(data: &[i64]) -> Shape {
1425+
Shape(Some(data.iter().map(|i| Some(*i)).collect()))
1426+
}
1427+
}
1428+
1429+
impl From<&[u64]> for Shape {
1430+
fn from(data: &[u64]) -> Shape {
1431+
Shape(Some(data.iter().map(|i| Some(*i as i64)).collect()))
1432+
}
1433+
}
1434+
14231435
impl Into<Option<Vec<Option<i64>>>> for Shape {
14241436
fn into(self) -> Option<Vec<Option<i64>>> {
14251437
self.0

0 commit comments

Comments
 (0)