File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ use crate::{
2222 Shape , Uiua , UiuaResult ,
2323} ;
2424
25- #[ cfg( feature = "bytes" ) ]
26- use super :: op_bytes_retry_fill;
2725use super :: { ArrayCmpSlice , FillContext } ;
2826
2927impl Value {
@@ -162,18 +160,14 @@ impl Value {
162160 Value :: Num ( a) => a. reshape ( & target_shape, env) ,
163161 #[ cfg( feature = "bytes" ) ]
164162 Value :: Byte ( a) => {
165- * self = op_bytes_retry_fill (
166- take ( a) ,
167- |mut a| {
168- a. reshape ( & target_shape, env) ?;
169- Ok ( a. into ( ) )
170- } ,
171- |mut a| {
172- a. reshape ( & target_shape, env) ?;
173- Ok ( a. into ( ) )
174- } ,
175- ) ?;
176- Ok ( ( ) )
163+ if env. num_fill ( ) . is_ok ( ) && env. byte_fill ( ) . is_err ( ) {
164+ let mut arr: Array < f64 > = a. convert_ref ( ) ;
165+ arr. reshape ( & target_shape, env) ?;
166+ * self = arr. into ( ) ;
167+ Ok ( ( ) )
168+ } else {
169+ a. reshape ( & target_shape, env)
170+ }
177171 }
178172 Value :: Complex ( a) => a. reshape ( & target_shape, env) ,
179173 Value :: Char ( a) => a. reshape ( & target_shape, env) ,
You can’t perform that action at this time.
0 commit comments