@@ -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 ( ) {
@@ -1298,7 +1298,7 @@ impl<T: ArrayValue> Array<T> {
12981298 return ;
12991299 }
13001300 let subshape = Shape :: from ( & self . shape [ depth..] ) ;
1301- let newshape = Shape :: from_iter ( subshape. iter ( ) . rev ( ) . copied ( ) ) ;
1301+ let newshape = subshape. iter ( ) . rev ( ) . copied ( ) . collect :: < Shape > ( ) ;
13021302 let chunk_size = subshape. elements ( ) ;
13031303 let data_slice = self . data . as_mut_slice ( ) ;
13041304 let mut temp = data_slice[ ..chunk_size] . to_vec ( ) ;
@@ -2014,7 +2014,10 @@ impl Value {
20142014 /// Convert a string value to a list of UTF-16 code units
20152015 pub fn utf16 ( & self , env : & Uiua ) -> UiuaResult < Self > {
20162016 let s = self . as_string ( env, "Argument to utf₁₆ must be a string" ) ?;
2017- Ok ( Array :: < f64 > :: from_iter ( s. encode_utf16 ( ) . map ( |u| u as f64 ) ) . into ( ) )
2017+ Ok ( s. encode_utf16 ( )
2018+ . map ( |u| u as f64 )
2019+ . collect :: < Array < f64 > > ( )
2020+ . into ( ) )
20182021 }
20192022 /// Convert a list of UTF-8 bytes to a string value
20202023 pub fn unutf8 ( & self , env : & Uiua ) -> UiuaResult < Self > {
0 commit comments