@@ -765,7 +765,7 @@ impl Value {
765765 if ishape. is_empty ( ) {
766766 return Ok ( Array :: < f64 > :: new ( 0 , CowSlice :: new ( ) ) . into ( ) ) ;
767767 }
768- let mut shape = Shape :: from_iter ( ishape. iter ( ) . map ( |d| d. unsigned_abs ( ) ) ) ;
768+ let mut shape = ishape. iter ( ) . map ( |d| d. unsigned_abs ( ) ) . collect :: < Shape > ( ) ;
769769 shape. push ( shape. len ( ) ) ;
770770 let data = range ( & ishape, start, env) ?;
771771 let mut value: Value = match data {
@@ -783,9 +783,9 @@ impl Value {
783783 env,
784784 "Shape should be a single integer or a list of integers" ,
785785 ) ?;
786- let shape = Shape :: from_iter ( ishape. iter ( ) . map ( |n| n. unsigned_abs ( ) ) ) ;
786+ let shape = ishape. iter ( ) . map ( |n| n. unsigned_abs ( ) ) . collect :: < Shape > ( ) ;
787787 let elems: usize = validate_size :: < f64 > ( shape. iter ( ) . copied ( ) , env) ?;
788- let data = EcoVec :: from_iter ( ( 0 ..elems) . map ( |i| i as f64 ) ) ;
788+ let data = ( 0 ..elems) . map ( |i| i as f64 ) . collect :: < EcoVec < _ > > ( ) ;
789789 let mut arr = Array :: new ( shape, data) ;
790790 let first_max = ishape. first ( ) . copied ( ) . unwrap_or ( 0 ) ;
791791 for ( i, s) in ishape. into_iter ( ) . enumerate ( ) {
@@ -1314,7 +1314,7 @@ impl<T: ArrayValue> Array<T> {
13141314 return ;
13151315 }
13161316 let subshape = Shape :: from ( & self . shape [ depth..] ) ;
1317- let newshape = Shape :: from_iter ( subshape. iter ( ) . rev ( ) . copied ( ) ) ;
1317+ let newshape = subshape. iter ( ) . rev ( ) . copied ( ) . collect :: < Shape > ( ) ;
13181318 let chunk_size = subshape. elements ( ) ;
13191319 let data_slice = self . data . as_mut_slice ( ) ;
13201320 let mut temp = data_slice[ ..chunk_size] . to_vec ( ) ;
@@ -2030,7 +2030,10 @@ impl Value {
20302030 /// Convert a string value to a list of UTF-16 code units
20312031 pub fn utf16 ( & self , env : & Uiua ) -> UiuaResult < Self > {
20322032 let s = self . as_string ( env, "Argument to utf₁₆ must be a string" ) ?;
2033- Ok ( Array :: < f64 > :: from_iter ( s. encode_utf16 ( ) . map ( |u| u as f64 ) ) . into ( ) )
2033+ Ok ( s. encode_utf16 ( )
2034+ . map ( |u| u as f64 )
2035+ . collect :: < Array < f64 > > ( )
2036+ . into ( ) )
20342037 }
20352038 /// Convert a list of UTF-8 bytes to a string value
20362039 pub fn unutf8 ( & self , env : & Uiua ) -> UiuaResult < Self > {
0 commit comments