MCPcopy Create free account
hub / github.com/faern/rustscript / string_to_file

Function string_to_file

src/main.rs:78–82  ·  view source on GitHub ↗
(path: P, data: &str)

Source from the content-addressed store, hash-verified

76}
77
78fn string_to_file<P: AsRef<Path>>(path: P, data: &str) -> Result<()> {
79 let path = path.as_ref();
80 let mut f = File::create(path).chain_err(|| format!("Unable to create {:?}", path))?;
81 f.write_all(data.as_bytes()).chain_err(|| format!("Unable to write {:?}", path))
82}
83
84fn create_app() -> App<'static, 'static> {
85 let verbose_arg = Arg::with_name("verbose")

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected