MCPcopy Index your code
hub / github.com/algoscienceacademy/RustUI / detect_project_name

Method detect_project_name

src/dev_server.rs:329–336  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

327 }
328
329 fn detect_project_name(&self) -> Result<String, Box<dyn std::error::Error>> {
330 let cargo_toml = fs::read_to_string("Cargo.toml")?;
331 let cargo_config: toml::Value = toml::from_str(&cargo_toml)?;
332 Ok(cargo_config["package"]["name"]
333 .as_str()
334 .unwrap_or("rust-native-project")
335 .to_string())
336 }
337
338 pub fn watch(&mut self, path: &str) -> Result<(), Box<dyn std::error::Error>> {
339 let (tx, rx) = channel();

Callers 1

load_project_configMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected