MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / write_project_device_selection

Function write_project_device_selection

packages/server/src/main.rs:2358–2366  ·  view source on GitHub ↗
(selection: &ProjectDeviceSelection)

Source from the content-addressed store, hash-verified

2356}
2357
2358fn write_project_device_selection(selection: &ProjectDeviceSelection) -> anyhow::Result<PathBuf> {
2359 let path = project_device_selection_path_for_root(&selection.project_root)?;
2360 if let Some(parent) = path.parent() {
2361 fs::create_dir_all(parent)?;
2362 }
2363 fs::write(&path, serde_json::to_vec_pretty(selection)?)
2364 .with_context(|| format!("write {}", path.display()))?;
2365 Ok(path)
2366}
2367
2368fn project_device_selection_path_for_root(root: &Path) -> anyhow::Result<PathBuf> {
2369 let mut hasher = DefaultHasher::new();

Callers 1

mainFunction · 0.85

Tested by

no test coverage detected