fn generate_cargo_toml(package_name: &str, dir: &Path) -> Result<(), failure::Error>
{
    let cargo_toml = File::create(dir.join("Cargo.toml"))?;
    {
        let mut w = BufWriter::new(cargo_toml);

        writeln!(w, "[package]")?;
        writeln!(w, "name = \"{0}\"", package_name)?;
        writeln!(w, "version = \"0.1.0\"")?;
    }

    Ok(())
}
/// Generates a minimal Cargo.toml for the crate in "dir".
Generates a minimal Cargo.toml for the crate in "dir".
Generates a minimal Cargo . toml for the crate in " dir " .
fn generate_cargo_toml(package_name: &str, dir: &Path) -> Result<(), failure::Error>
{
    let cargo_toml = File::create(dir.join("Cargo.toml"))?;
    {
        let mut w = BufWriter::new(cargo_toml);
        writeln!(w, "[package]")?;
        writeln!(w, "name = \"{0}\"", package_name)?;
        writeln!(w, "version = \"0.1.0\"")?;
    }
    Ok(())
}
fn generate_cargo_toml ( package_name : & str , dir : & Path ) -> Result < ( ) , failure :: Error > { let cargo_toml = File :: create ( dir . join ( " " ) ) ? ; { let mut w = BufWriter :: new ( cargo_toml ) ; writeln ! ( w " " ) ? ; writeln ! ( w " \" \" " package_name ) ? ; writeln ! ( w " \" \" " ) ? ; } Ok ( ( ) ) }
Generates a minimal Cargo.toml for the crate in "dir".
Generates a minimal Cargo . toml for the crate in " dir " .
package_name
&str
dir
&Path
package_name
&str
dir
&Path