From d956f3ce5b04d03d7d7c870c24716316ee9dc027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Delabrouille?= Date: Thu, 30 May 2024 11:17:20 +0200 Subject: [PATCH] add generic impl of @C into Span based ond ArrayToSpan --- corelib/src/array.cairo | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/corelib/src/array.cairo b/corelib/src/array.cairo index f4e8a6561d1..8a6b4a07cd2 100644 --- a/corelib/src/array.cairo +++ b/corelib/src/array.cairo @@ -152,12 +152,6 @@ impl ArrayIntoSpan> of Into, Span> { } } -impl ArraySnapIntoSpan of Into<@Array, Span> { - fn into(self: @Array) -> Span { - ArrayTrait::span(self) - } -} - impl SpanIntoArray, +Clone> of Into, Array> { fn into(mut self: Span) -> Array { let mut arr = array![]; @@ -277,6 +271,12 @@ impl ArrayToSpan of ToSpanTrait, T> { } } +impl SnapIntoSpanWhereToSpanTrait> of Into<@C, Span> { + fn into(self: @C) -> Span { + 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.