list editor: get_data_port() make map on list instead of seq

This commit is contained in:
Michael Sippel 2024-09-01 23:34:52 +02:00
parent 6ed456e3ff
commit 7f18fd7755
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -162,9 +162,9 @@ impl ListEditor {
} }
pub fn get_data_port(&self) -> OuterViewPort<dyn SequenceView<Item = EditTree>> { pub fn get_data_port(&self) -> OuterViewPort<dyn SequenceView<Item = EditTree>> {
self.data.get_port().to_sequence().map( self.data.get_port().to_list().map(
|x| x.read().unwrap().clone() |x| x.read().unwrap().clone()
) ).to_sequence()
} }
/* /*
pub fn get_data(&self) -> Arc<RwLock<ReprTree>> { pub fn get_data(&self) -> Arc<RwLock<ReprTree>> {
@ -186,7 +186,7 @@ impl ListEditor {
} else { } else {
None None
} }
} }
pub fn get_item_mut(&mut self) -> Option<MutableVecAccess<Arc<RwLock<EditTree>>>> { pub fn get_item_mut(&mut self) -> Option<MutableVecAccess<Arc<RwLock<EditTree>>>> {
if let Some(idx) = self.cursor.get().idx { if let Some(idx) = self.cursor.get().idx {