Added the concept of subtypes ...

... which `try` now uses to avoid some problems with inner types
This commit is contained in:
Mark
2023-10-24 09:31:49 +02:00
parent ea95a16c30
commit 5e20f92849
13 changed files with 111 additions and 13 deletions

View File

@@ -83,7 +83,7 @@ impl Config {
#[derive(Clone, Debug)]
pub struct RunCommandError(String);
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct RunCommandErrorT;
impl MersData for RunCommandError {
fn is_eq(&self, other: &dyn MersData) -> bool {
@@ -116,6 +116,9 @@ impl MersType for RunCommandErrorT {
fn is_included_in_single(&self, target: &dyn MersType) -> bool {
self.is_same_type_as(target)
}
fn subtypes(&self, acc: &mut Type) {
acc.add(Arc::new(self.clone()));
}
fn as_any(&self) -> &dyn std::any::Any {
self
}