mirror of https://github.com/stelzo/typst.git
Fix fold order for vectors (#3496)
This commit is contained in:
parent
ca5d682edb
commit
85db05727b
|
|
@ -731,16 +731,16 @@ impl<T: Fold> Fold for Option<T> {
|
|||
}
|
||||
|
||||
impl<T> Fold for Vec<T> {
|
||||
fn fold(mut self, outer: Self) -> Self {
|
||||
self.extend(outer);
|
||||
self
|
||||
fn fold(self, mut outer: Self) -> Self {
|
||||
outer.extend(self);
|
||||
outer
|
||||
}
|
||||
}
|
||||
|
||||
impl<T, const N: usize> Fold for SmallVec<[T; N]> {
|
||||
fn fold(mut self, outer: Self) -> Self {
|
||||
self.extend(outer);
|
||||
self
|
||||
fn fold(self, mut outer: Self) -> Self {
|
||||
outer.extend(self);
|
||||
outer
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,6 @@ impl LayoutMultiple for Packed<EnumElem> {
|
|||
let mut cells = vec![];
|
||||
let mut number = self.start(styles);
|
||||
let mut parents = EnumElem::parents_in(styles);
|
||||
parents.reverse();
|
||||
|
||||
let full = self.full(styles);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
|
|
@ -0,0 +1,20 @@
|
|||
// Test fold order of vectors.
|
||||
|
||||
---
|
||||
#set text(features: (liga: 1))
|
||||
#set text(features: (liga: 0))
|
||||
fi
|
||||
|
||||
---
|
||||
#underline(stroke: aqua + 4pt)[
|
||||
#underline[Hello]
|
||||
]
|
||||
|
||||
---
|
||||
#let c = counter("mycounter")
|
||||
#c.update(1)
|
||||
#locate(loc => [
|
||||
#c.update(2)
|
||||
#c.at(loc) \
|
||||
Second: #locate(loc => c.at(loc))
|
||||
])
|
||||
Loading…
Reference in New Issue