mirror of
https://github.com/typst/typst
synced 2025-06-28 08:12:53 +08:00
Replaced into_iter
to iter
(#2398)
This commit is contained in:
parent
e4d9db83ea
commit
d25c5ac9a2
@ -106,7 +106,8 @@ cast! {
|
||||
impl BibliographyElem {
|
||||
/// Find the document's bibliography.
|
||||
pub fn find(introspector: Tracked<Introspector>) -> StrResult<Self> {
|
||||
let mut iter = introspector.query(&Self::elem().select()).into_iter();
|
||||
let query = introspector.query(&Self::elem().select());
|
||||
let mut iter = query.iter();
|
||||
let Some(elem) = iter.next() else {
|
||||
bail!("the document does not contain a bibliography");
|
||||
};
|
||||
@ -122,7 +123,7 @@ impl BibliographyElem {
|
||||
pub fn has(vt: &Vt, key: &str) -> bool {
|
||||
vt.introspector
|
||||
.query(&Self::elem().select())
|
||||
.into_iter()
|
||||
.iter()
|
||||
.flat_map(|elem| {
|
||||
let elem = elem.to::<Self>().unwrap();
|
||||
load(&elem.path(), &elem.data())
|
||||
@ -137,7 +138,7 @@ impl BibliographyElem {
|
||||
) -> Vec<(EcoString, Option<EcoString>)> {
|
||||
Self::find(introspector)
|
||||
.and_then(|elem| load(&elem.path(), &elem.data()))
|
||||
.into_iter()
|
||||
.iter()
|
||||
.flatten()
|
||||
.map(|entry| {
|
||||
let key = entry.key().into();
|
||||
|
@ -17,8 +17,8 @@ pub fn write_outline(ctx: &mut PdfContext) -> Option<Ref> {
|
||||
// Therefore, its next descendant must be added at its level, which is
|
||||
// enforced in the manner shown below.
|
||||
let mut last_skipped_level = None;
|
||||
for heading in ctx.introspector.query(&item!(heading_elem).select()) {
|
||||
let leaf = HeadingNode::leaf((*heading).clone());
|
||||
for heading in ctx.introspector.query(&item!(heading_elem).select()).iter() {
|
||||
let leaf = HeadingNode::leaf((**heading).clone());
|
||||
|
||||
if leaf.bookmarked {
|
||||
let mut children = &mut tree;
|
||||
|
Loading…
x
Reference in New Issue
Block a user