MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / create

Function create

crates/ruff_python_resolver/src/lib.rs:38–47  ·  view source on GitHub ↗

Create a file at the given path with the given content.

(path: PathBuf, content: &str)

Source from the content-addressed store, hash-verified

36
37 /// Create a file at the given path with the given content.
38 fn create(path: PathBuf, content: &str) -> io::Result<PathBuf> {
39 if let Some(parent) = path.parent() {
40 create_dir_all(parent)?;
41 }
42 let mut f = File::create(&path)?;
43 f.write_all(content.as_bytes())?;
44 f.sync_all()?;
45
46 Ok(path)
47 }
48
49 /// Create an empty file at the given path.
50 fn empty(path: PathBuf) -> io::Result<PathBuf> {

Callers 7

mainFunction · 0.85
unzip_typeshedFunction · 0.85
emptyFunction · 0.85
partialFunction · 0.85
typedFunction · 0.85
add_import_resultMethod · 0.85
get_import_resultMethod · 0.85

Calls 1

parentMethod · 0.80

Tested by

no test coverage detected