Skip to content

Commit 691acbf

Browse files
Simplify and fix restructure
1 parent bc43300 commit 691acbf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ArrayInterfaceStaticArraysCore/src/ArrayInterfaceStaticArraysCore.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function ArrayInterfaceCore.lu_instance(_A::StaticArraysCore.StaticMatrix{N,N})
1515
end
1616

1717
function ArrayInterfaceCore.restructure(x::StaticArraysCore.SArray{S,T,N}, y::StaticArraysCore.SArray) where {S,T,N}
18-
reshape(y, StaticArraysCore.size_to_tuple(S))
18+
StaticArraysCore.SArray{S,T,N}(y)
1919
end
2020
ArrayInterfaceCore.restructure(x::StaticArraysCore.SArray{S}, y) where {S} = StaticArraysCore.SArray{S}(y)
2121

lib/ArrayInterfaceStaticArraysCore/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ y = @SVector rand(4)
2121
yr = ArrayInterfaceCore.restructure(x, y)
2222
@test yr isa SMatrix{2, 2}
2323
@test Base.size(yr) == (2,2)
24-
@test vec(yr) == vec(y)
24+
@test vec(yr) == vec(Float32.(y))
2525
z = rand(4)
2626
zr = ArrayInterfaceCore.restructure(x, z)
2727
@test zr isa SMatrix{2, 2}

0 commit comments

Comments
 (0)