singleton2sequence: value only at first element
fixes chain with singleton tosequence filter
This commit is contained in:
parent
47b8900adc
commit
6867297eea
2 changed files with 7 additions and 13 deletions
|
@ -66,18 +66,8 @@ impl ListEditor {
|
||||||
addr_port: VecBuffer::<OuterViewPort<dyn SequenceView<Item = isize>>>::with_data(
|
addr_port: VecBuffer::<OuterViewPort<dyn SequenceView<Item = isize>>>::with_data(
|
||||||
vec![
|
vec![
|
||||||
cursor.get_port()
|
cursor.get_port()
|
||||||
.map(
|
|
||||||
|x| {
|
|
||||||
// todo implement this with filter_map
|
|
||||||
let mut b = VecBuffer::new();
|
|
||||||
if let Some(i) = x.idx {
|
|
||||||
b.push(i);
|
|
||||||
}
|
|
||||||
b.get_port().to_sequence()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.to_sequence()
|
.to_sequence()
|
||||||
.flatten(),
|
.filter_map(|cur| cur.idx),
|
||||||
cursor.get_port()
|
cursor.get_port()
|
||||||
.map({
|
.map({
|
||||||
let data = data.clone();
|
let data = data.clone();
|
||||||
|
|
|
@ -51,8 +51,12 @@ where
|
||||||
{
|
{
|
||||||
type Item = SrcView::Item;
|
type Item = SrcView::Item;
|
||||||
|
|
||||||
fn get(&self, _idx: &usize) -> Option<Self::Item> {
|
fn get(&self, idx: &usize) -> Option<Self::Item> {
|
||||||
Some(self.src_view.as_ref()?.get())
|
if *idx == 0 {
|
||||||
|
Some(self.src_view.as_ref()?.get())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn len(&self) -> Option<usize> {
|
fn len(&self) -> Option<usize> {
|
||||||
|
|
Loading…
Reference in a new issue