pub fn print_msg<P: AsRef<Path>>(
    file_path: P,
    meta: &Metadata,
) -> IoResult<()> {
    let (_version, name, authors, homepage) =
        (&meta.version, &meta.name, &meta.authors, &meta.homepage);

    let stderr = BufferWriter::stderr(ColorChoice::Auto);
    let mut buffer = stderr.buffer();
    buffer.set_color(ColorSpec::new().set_fg(Some(Color::White)))?;

    writeln!(&mut buffer, "Well, this is embarrassing.\n")?;
    writeln!(
        &mut buffer,
        "{} had a problem and crashed. To help us diagnose the \
     problem you can send us a crash report.\n",
        name
    )?;
    writeln!(
        &mut buffer,
        "There is a log file of the crash at \"{}\". Please submit an \
     issue or email with the subject of \"{} Crash Report\" and include the \
     log as an attachment.\n",
        file_path.as_ref().display(),
        name
    )?;

    if !homepage.is_empty() {
        writeln!(&mut buffer, "- Homepage: {}", homepage)?;
    }
    if !authors.is_empty() {
        writeln!(&mut buffer, "- Authors: {}", authors)?;
    }
    writeln!(
        &mut buffer,
        "\nWe take privacy seriously, and do not perform any \
     automated error collection. In order to improve the software, we rely on \
     people to submit reports.\n"
    )?;
    writeln!(&mut buffer, "Thank you!")?;

    buffer.reset()?;

    stderr.print(&buffer).unwrap();
    Ok(())
}
/// Utility function that prints a message to our human users
Utility function that prints a message to our human users
Utility function that prints a message to our human users
pub fn print_msg<P: AsRef<Path>>(
    file_path: P,
    meta: &Metadata,
) -> IoResult<()> {
    let (_version, name, authors, homepage) =
        (&meta.version, &meta.name, &meta.authors, &meta.homepage);
    let stderr = BufferWriter::stderr(ColorChoice::Auto);
    let mut buffer = stderr.buffer();
    buffer.set_color(ColorSpec::new().set_fg(Some(Color::White)))?;
    writeln!(&mut buffer, "Well, this is embarrassing.\n")?;
    writeln!(
        &mut buffer,
        "{} had a problem and crashed. To help us diagnose the \
     problem you can send us a crash report.\n",
        name
    )?;
    writeln!(
        &mut buffer,
        "There is a log file of the crash at \"{}\". Please submit an \
     issue or email with the subject of \"{} Crash Report\" and include the \
     log as an attachment.\n",
        file_path.as_ref().display(),
        name
    )?;
    if !homepage.is_empty() {
        writeln!(&mut buffer, "- Homepage: {}", homepage)?;
    }
    if !authors.is_empty() {
        writeln!(&mut buffer, "- Authors: {}", authors)?;
    }
    writeln!(
        &mut buffer,
        "\nWe take privacy seriously, and do not perform any \
     automated error collection. In order to improve the software, we rely on \
     people to submit reports.\n"
    )?;
    writeln!(&mut buffer, "Thank you!")?;
    buffer.reset()?;
    stderr.print(&buffer).unwrap();
    Ok(())
}
pub fn print_msg < P : AsRef < Path > > ( file_path : P , meta : & Metadata , ) -> IoResult < ( ) > { let ( _version , name , authors , homepage ) = ( & meta . version , & meta . name , & meta . authors , & meta . homepage ) ; let stderr = BufferWriter :: stderr ( ColorChoice :: Auto ) ; let mut buffer = stderr . buffer ( ) ; buffer . set_color ( ColorSpec :: new ( ) . set_fg ( Some ( Color :: White ) ) ) ? ; writeln ! ( mut buffer " \n " ) ? ; writeln ! ( mut buffer " \
 \n " name ) ? ; writeln ! ( mut buffer " \" \" \
 \" \" \
 \n " file_path as_ref ( ) display ( ) name ) ? ; if ! homepage . is_empty ( ) { writeln ! ( mut buffer " " homepage ) ? ; } if ! authors . is_empty ( ) { writeln ! ( mut buffer " " authors ) ? ; } writeln ! ( mut buffer " \n \
 \
 \n " ) ? ; writeln ! ( mut buffer " " ) ? ; buffer . reset ( ) ? ; stderr . print ( & buffer ) . unwrap ( ) ; Ok ( ( ) ) }
Utility function that prints a message to our human users
Utility function that prints a message to our human users
file_path
P
meta
&Metadata
file_path
P
meta
&Metadata