fn read_from_url(url: &str) -> Result<Vec<u8>> {
    let mut data = Vec::new();
    let mut handle = Easy::new();
    handle.fail_on_error(true)?;
    handle.url(url)?;
    {
        let mut transfer = handle.transfer();
        transfer
            .write_function(|new_data| {
                data.extend_from_slice(new_data);
                Ok(new_data.len())
            })
            .unwrap();
        transfer.perform().unwrap();
    }
    Ok(data)
}
/// Helper for download file from URL
///
/// - This function expands obtained data into memory space
///
Helper for download file from URL
This function expands obtained data into memory space
Helper for download file from URL This function expands obtained data into memory space
fn read_from_url(url: &str) -> Result<Vec<u8>> {
    let mut data = Vec::new();
    let mut handle = Easy::new();
    handle.fail_on_error(true)?;
    handle.url(url)?;
    {
        let mut transfer = handle.transfer();
        transfer
            .write_function(|new_data| {
                data.extend_from_slice(new_data);
                Ok(new_data.len())
            })
            .unwrap();
        transfer.perform().unwrap();
    }
    Ok(data)
}
fn read_from_url ( url : & str ) -> Result < Vec < u8 > > { let mut data = Vec :: new ( ) ; let mut handle = Easy :: new ( ) ; handle . fail_on_error ( true ) ? ; handle . url ( url ) ? ; { let mut transfer = handle . transfer ( ) ; transfer . write_function ( | new_data | { data . extend_from_slice ( new_data ) ; Ok ( new_data . len ( ) ) } ) . unwrap ( ) ; transfer . perform ( ) . unwrap ( ) ; } Ok ( data ) }
Helper for download file from URL
 This function expands obtained data into memory space
Helper for download file from URL This function expands obtained data into memory space
url
&str
url
&str