use std::path::Path;
use crate::TypeCollection;
pub trait Language {
type Error: std::error::Error + From<std::io::Error>;
fn export(&self, type_map: &TypeCollection) -> Result<String, Self::Error>;
fn format(&self, path: &Path) -> Result<(), Self::Error>;
}
impl<T: Language> Language for &T {
type Error = T::Error;
fn export(&self, type_map: &TypeCollection) -> Result<String, Self::Error> {
(*self).export(type_map)
}
fn format(&self, path: &Path) -> Result<(), Self::Error> {
(*self).format(path)
}
}