@@ -516,7 +516,7 @@ impl Value {
516516 if ishape. is_empty ( ) {
517517 return Ok ( Array :: < f64 > :: new ( 0 , CowSlice :: new ( ) ) . into ( ) ) ;
518518 }
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 > ( ) ;
520520 shape. push ( shape. len ( ) ) ;
521521 let data = range ( & ishape, start, env) ?;
522522 let mut value: Value = match data {
@@ -534,9 +534,9 @@ impl Value {
534534 env,
535535 "Shape should be a single integer or a list of integers" ,
536536 ) ?;
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 > ( ) ;
538538 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 < _ > > ( ) ;
540540 let mut arr = Array :: new ( shape, data) ;
541541 let first_max = ishape. first ( ) . copied ( ) . unwrap_or ( 0 ) ;
542542 for ( i, s) in ishape. into_iter ( ) . enumerate ( ) {
@@ -1077,7 +1077,7 @@ impl<T: ArrayValue> Array<T> {
10771077 return ;
10781078 }
10791079 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 > ( ) ;
10811081 let chunk_size = subshape. elements ( ) ;
10821082 let data_slice = self . data . as_mut_slice ( ) ;
10831083 let mut temp = data_slice[ ..chunk_size] . to_vec ( ) ;
@@ -1787,7 +1787,10 @@ impl Value {
17871787 /// Convert a string value to a list of UTF-16 code units
17881788 pub fn utf16 ( & self , env : & Uiua ) -> UiuaResult < Self > {
17891789 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 ( ) )
17911794 }
17921795 /// Convert a list of UTF-8 bytes to a string value
17931796 pub fn unutf8 ( & self , env : & Uiua ) -> UiuaResult < Self > {
0 commit comments