Fix for slice_to_components

Using `slice_to_components` wouldn't compile because `s.data` is type of `rawptr` and return type is `^T`
This commit is contained in:
Despacito696969
2022-04-05 20:17:47 +02:00
committed by GitHub
parent ca549939f3
commit 7f6c6945ae
+1 -1
View File
@@ -166,7 +166,7 @@ slice_data_cast :: proc "contextless" ($T: typeid/[]$A, slice: $S/[]$B) -> T {
slice_to_components :: proc "contextless" (slice: $E/[]$T) -> (data: ^T, len: int) {
s := transmute(Raw_Slice)slice
return s.data, s.len
return (^T)(s.data), s.len
}
buffer_from_slice :: proc "contextless" (backing: $T/[]$E) -> [dynamic]E {