Skip to content

Commit

Permalink
add: impl ArraySnapIntoSpan
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro committed May 27, 2024
1 parent f5c5973 commit 2583511
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions corelib/src/array.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ impl ArrayIntoSpan<T, +Drop<T>> of Into<Array<T>, Span<T>> {
}
}

impl ArraySnapIntoSpan<T> of Into<@Array<T>, Span<T>> {
fn into(self: @Array<T>) -> Span<T> {
self.span()
}
}

impl SpanIntoArray<T, +Drop<T>, +Clone<T>> of Into<Span<T>, Array<T>> {
fn into(mut self: Span<T>) -> Array<T> {
let mut arr = array![];
Expand Down

0 comments on commit 2583511

Please sign in to comment.