#[derive(Clone)]
pub struct CSharpMapper {
base: BaseLanguageMapper,
}
impl CSharpMapper {
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
base: BaseLanguageMapper::new(Language::CSharp),
}
}
}
#[async_trait]
impl LanguageMapper for CSharpMapper {
fn language(&self) -> Language {
self.base.language()
}
async fn map_file(&self, path: &Path) -> Result<Vec<UnifiedNode>> {
self.base.map_file(path).await
}
async fn map_directory(&self, path: &Path, recursive: bool) -> Result<Vec<UnifiedNode>> {
self.base.map_directory(path, recursive).await
}
async fn map_source(&self, source: &str, path: &Path) -> Result<Vec<UnifiedNode>> {
self.base.map_source(source, path).await
}
fn convert_ast_items(&self, items: &[AstItem], path: &Path) -> Vec<UnifiedNode> {
self.base.convert_ast_items(items, path)
}
fn clone_box(&self) -> Box<dyn LanguageMapper> {
Box::new(self.clone())
}
}
#[derive(Clone)]
pub struct RubyMapper {
base: BaseLanguageMapper,
}
impl RubyMapper {
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
Self {
base: BaseLanguageMapper::new(Language::Ruby),
}
}
}
#[async_trait]
impl LanguageMapper for RubyMapper {
fn language(&self) -> Language {
self.base.language()
}
async fn map_file(&self, path: &Path) -> Result<Vec<UnifiedNode>> {
self.base.map_file(path).await
}
async fn map_directory(&self, path: &Path, recursive: bool) -> Result<Vec<UnifiedNode>> {
self.base.map_directory(path, recursive).await
}
async fn map_source(&self, source: &str, path: &Path) -> Result<Vec<UnifiedNode>> {
self.base.map_source(source, path).await
}
fn convert_ast_items(&self, items: &[AstItem], path: &Path) -> Vec<UnifiedNode> {
self.base.convert_ast_items(items, path)
}
fn clone_box(&self) -> Box<dyn LanguageMapper> {
Box::new(self.clone())
}
}