make list.get_mut return a 1-tuple on success, and fix reference type being incomplete

This commit is contained in:
Mark
2024-02-22 19:41:03 +01:00
parent 05c88b7826
commit dc2db1d0e8
3 changed files with 32 additions and 23 deletions

View File

@@ -7,7 +7,7 @@ use std::{
use super::{Data, MersData, MersType, Type};
#[derive(Debug, Clone)]
pub struct Reference(pub Arc<RwLock<Data>>);
pub struct Reference(pub Arc<RwLock<Data>>, pub Type);
impl MersData for Reference {
fn is_eq(&self, other: &dyn MersData) -> bool {
@@ -21,7 +21,7 @@ impl MersData for Reference {
Box::new(Clone::clone(self))
}
fn as_type(&self) -> Type {
Type::new(ReferenceT(self.0.write().unwrap().get().as_type()))
Type::new(ReferenceT(self.1.clone()))
}
fn as_any(&self) -> &dyn Any {
self