/// Tell the user more info about the file
///
/// It seems verbose but you can see this error often so it save you time.
Tell the user more info about the file
It seems verbose but you can see this error often so it save you time.
Tell the user more info about the file It seems verbose but you can see this error often so it save you time .
fn helpful_complaint(p: &Path, header: &[u8]) -> Error {
    let cap = ::std::cmp::min(header.len(), 100);
    let complaint = format!(
        "Expected {} to be an uncompressed numpy (.npy) file, but couldn't \
        parse the header. The first hundred bytes look like:
        {}
        As bytes, the header is as follows:
        {:?}
        It should look something like this example, where . are non-printable characters: \
        NUMPY..{{'descr': '<f8', 'fortran_order': False, 'shape': (34, 27)}}\
        Note: Cabarrus only supports 2D big-endian 64-bit float matrices in C order (for \
        simplicity). You may need to change the dtype accordingly.",
        p.display(),
        String::from_utf8_lossy(&header[..cap]),
        &header[..cap]);
    Error::Other(complaint)
}
fn helpful_complaint ( p : & Path , header : & [ u8 ] ) -> Error { let cap = :: std :: cmp :: min ( header . len ( ) , 100 ) ; let complaint = format ! ( " \
 \
 \
 \
 " p display ( ) String from_utf8_lossy ( header [ cap ] ) header [ cap ] ) ; Error :: Other ( complaint ) }
Tell the user more info about the file
It seems verbose but you can see this error often so it save you time.
Tell the user more info about the file It seems verbose but you can see this error often so it save you time .
p
&Path
header
&[u8]