use crate::errors::BumperError; use crate::rust::Rust; use std::path::Path; pub enum ProjectKind { Rust(Rust), } impl ProjectKind { pub fn detect>(dirname: P) -> Result { let dirname = dirname.as_ref(); if let Ok(p) = Rust::new(dirname) { return Ok(Self::Rust(p)); } Err(BumperError::UnknownProjectKind(dirname.to_path_buf())) } pub fn set_version(&mut self, version: &str) -> Result<(), BumperError> { match self { Self::Rust(ref mut rust) => rust.set_version(version)?, } Ok(()) } }