Skip to content

Commit

Permalink
add generic impl of @C into Span<T> based ond ArrayToSpan
Browse files Browse the repository at this point in the history
  • Loading branch information
tdelabro committed May 30, 2024
1 parent 7f4876a commit d956f3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions corelib/src/array.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ 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> {
ArrayTrait::span(self)
}
}

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 Expand Up @@ -277,6 +271,12 @@ impl ArrayToSpan<T> of ToSpanTrait<Array<T>, T> {
}
}

impl SnapIntoSpanWhereToSpanTrait<C, T, +ToSpanTrait<C, T>> of Into<@C, Span<T>> {
fn into(self: @C) -> Span<T> {
self.span()
}
}

/// Returns a span from a box of struct of members of the same type.
/// The additional `+Copy<@T>` arg is to prevent later stages from propagating the `S` type Sierra
/// level, where it is deduced by the `T` type.
Expand Down

0 comments on commit d956f3c

Please sign in to comment.