MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / write_tmp

Function write_tmp

crates/openshell-server/src/config_file.rs:327–334  ·  view source on GitHub ↗
(contents: &str)

Source from the content-addressed store, hash-verified

325 use std::io::Write;
326
327 fn write_tmp(contents: &str) -> tempfile::NamedTempFile {
328 let mut tmp = tempfile::Builder::new()
329 .suffix(".toml")
330 .tempfile()
331 .expect("tempfile");
332 tmp.write_all(contents.as_bytes()).expect("write");
333 tmp
334 }
335
336 #[test]
337 fn empty_file_yields_default_config() {

Calls

no outgoing calls