(&self)
| 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(); |