@@ -516,7 +516,7 @@ impl Value {
516
516
if ishape. is_empty ( ) {
517
517
return Ok ( Array :: < f64 > :: new ( 0 , CowSlice :: new ( ) ) . into ( ) ) ;
518
518
}
519
- let mut shape = Shape :: from_iter ( ishape. iter ( ) . map ( |d| d. unsigned_abs ( ) ) ) ;
519
+ let mut shape = ishape. iter ( ) . map ( |d| d. unsigned_abs ( ) ) . collect :: < Shape > ( ) ;
520
520
shape. push ( shape. len ( ) ) ;
521
521
let data = range ( & ishape, start, env) ?;
522
522
let mut value: Value = match data {
@@ -534,9 +534,9 @@ impl Value {
534
534
env,
535
535
"Shape should be a single integer or a list of integers" ,
536
536
) ?;
537
- let shape = Shape :: from_iter ( ishape. iter ( ) . map ( |n| n. unsigned_abs ( ) ) ) ;
537
+ let shape = ishape. iter ( ) . map ( |n| n. unsigned_abs ( ) ) . collect :: < Shape > ( ) ;
538
538
let elems: usize = validate_size :: < f64 > ( shape. iter ( ) . copied ( ) , env) ?;
539
- let data = EcoVec :: from_iter ( ( 0 ..elems) . map ( |i| i as f64 ) ) ;
539
+ let data = ( 0 ..elems) . map ( |i| i as f64 ) . collect :: < EcoVec < _ > > ( ) ;
540
540
let mut arr = Array :: new ( shape, data) ;
541
541
let first_max = ishape. first ( ) . copied ( ) . unwrap_or ( 0 ) ;
542
542
for ( i, s) in ishape. into_iter ( ) . enumerate ( ) {
@@ -1077,7 +1077,7 @@ impl<T: ArrayValue> Array<T> {
1077
1077
return ;
1078
1078
}
1079
1079
let subshape = Shape :: from ( & self . shape [ depth..] ) ;
1080
- let newshape = Shape :: from_iter ( subshape. iter ( ) . rev ( ) . copied ( ) ) ;
1080
+ let newshape = subshape. iter ( ) . rev ( ) . copied ( ) . collect :: < Shape > ( ) ;
1081
1081
let chunk_size = subshape. elements ( ) ;
1082
1082
let data_slice = self . data . as_mut_slice ( ) ;
1083
1083
let mut temp = data_slice[ ..chunk_size] . to_vec ( ) ;
@@ -1787,7 +1787,10 @@ impl Value {
1787
1787
/// Convert a string value to a list of UTF-16 code units
1788
1788
pub fn utf16 ( & self , env : & Uiua ) -> UiuaResult < Self > {
1789
1789
let s = self . as_string ( env, "Argument to utf₁₆ must be a string" ) ?;
1790
- Ok ( Array :: < f64 > :: from_iter ( s. encode_utf16 ( ) . map ( |u| u as f64 ) ) . into ( ) )
1790
+ Ok ( s. encode_utf16 ( )
1791
+ . map ( |u| u as f64 )
1792
+ . collect :: < Array < f64 > > ( )
1793
+ . into ( ) )
1791
1794
}
1792
1795
/// Convert a list of UTF-8 bytes to a string value
1793
1796
pub fn unutf8 ( & self , env : & Uiua ) -> UiuaResult < Self > {
0 commit comments