fn copy_as_source(input: &mut dyn std::io::Read, dir: &Path)
    -> Result<Box<PathBuf>, failure::Error>
{
    // To support cargo source files must be in "src" directory.
    let src = dir.join("src");
    std::fs::create_dir_all(&src)?;

    // By default the crate must have either lib.rs or main rs.
    let target = src.join("lib.rs");
    std::io::copy(input, &mut File::create(&target)?)?;

    Ok(Box::new(target))
}
/// Copies the input file as a source file for the project.
Copies the input file as a source file for the project.
Copies the input file as a source file for the project .
fn copy_as_source(input: &mut dyn std::io::Read, dir: &Path)
    -> Result<Box<PathBuf>, failure::Error>
{
    // To support cargo source files must be in "src" directory.
    let src = dir.join("src");
    std::fs::create_dir_all(&src)?;
    // By default the crate must have either lib.rs or main rs.
    let target = src.join("lib.rs");
    std::io::copy(input, &mut File::create(&target)?)?;
    Ok(Box::new(target))
}
fn copy_as_source ( input : & mut dyn std :: io :: Read , dir : & Path ) -> Result < Box < PathBuf > , failure :: Error > { // To support cargo source files must be in "src" directory. let src = dir . join ( " " ) ; std :: fs :: create_dir_all ( & src ) ? ; // By default the crate must have either lib.rs or main rs. let target = src . join ( " " ) ; std :: io :: copy ( input , & mut File :: create ( & target ) ? ) ? ; Ok ( Box :: new ( target ) ) }
Copies the input file as a source file for the project.
Copies the input file as a source file for the project .
input
&mut dyn std::io::Read
dir
&Path
input
&mut dyn std::io::Read
dir
&Path