gesha-core 0.0.12

Core functionality for Gesha project
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Result;
use crate::io::Error::CannotCopyFile;
use crate::io::Writer;
use std::path::Path;

impl Writer {
    pub fn copy_from<B: AsRef<Path>>(self, from: B) -> Result<()> {
        std::fs::copy(&from, &self.path).map_err(|cause| CannotCopyFile {
            from: from.as_ref().into(),
            to: self.path,
            detail: format!("{:?}", cause),
        })?;
        Ok(())
    }
}