Copy A File To Another Location In Rust

Code
use std::fs;

fn main() -> std::io::Result<()> {
    fs::copy("foo.txt", "bar.txt")?;
    Ok(())
}

Reference

Function std::fs::copy

The builtin function that the contents of one file to another