pub fn cast_bool_to_utf8<O: Offset>(array: &dyn Array) -> Result<Box<dyn Array>> {
    let array = array.as_any().downcast_ref::<BooleanArray>().unwrap();

    let iter = array.iter().map(|x| x.map(|x| if x { "1" } else { "0" }));

    // Soundness:
    //     The iterator is trustedLen
    let array = unsafe { Utf8Array::<O>::from_trusted_len_iter(iter) };

    Ok(Box::new(array))
}
/// Cast Boolean types to numeric
///
/// `false` returns 0 while `true` returns 1
Cast Boolean types to numeric
`false` returns 0 while `true` returns 1
Cast Boolean types to numeric ` false ` returns 0 while ` true ` returns 1
pub fn cast_bool_to_utf8<O: Offset>(array: &dyn Array) -> Result<Box<dyn Array>> {
    let array = array.as_any().downcast_ref::<BooleanArray>().unwrap();
    let iter = array.iter().map(|x| x.map(|x| if x { "1" } else { "0" }));
    // Soundness:
    //     The iterator is trustedLen
    let array = unsafe { Utf8Array::<O>::from_trusted_len_iter(iter) };
    Ok(Box::new(array))
}
pub fn cast_bool_to_utf8 < O : Offset > ( array : & dyn Array ) -> Result < Box < dyn Array > > { let array = array . as_any ( ) . downcast_ref :: < BooleanArray > ( ) . unwrap ( ) ; let iter = array . iter ( ) . map ( | x | x . map ( | x | if x { " " } else { " " } ) ) ; // Soundness: //     The iterator is trustedLen let array = unsafe { Utf8Array :: < O > :: from_trusted_len_iter ( iter ) } ; Ok ( Box :: new ( array ) ) }
Cast Boolean types to numeric
`false` returns 0 while `true` returns 1
Cast Boolean types to numeric ` false ` returns 0 while ` true ` returns 1
array
&dyn Array
array
&dyn Array