diff options
Diffstat (limited to 'src/model/mod.rs')
| -rw-r--r-- | src/model/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/model/mod.rs b/src/model/mod.rs index 4ec7311a..92c4293b 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -14,7 +14,7 @@ pub use self::styles::*; pub use typst_macros::element; -use comemo::{Constraint, Track, Tracked, TrackedMut}; +use comemo::{Track, Tracked, TrackedMut, Validate}; use crate::diag::SourceResult; use crate::doc::Document; @@ -25,7 +25,7 @@ use crate::World; #[comemo::memoize] #[tracing::instrument(skip(world, tracer, content))] pub fn typeset( - world: Tracked<dyn World>, + world: Tracked<dyn World + '_>, mut tracer: TrackedMut<Tracer>, content: &Content, ) -> SourceResult<Document> { @@ -42,8 +42,8 @@ pub fn typeset( loop { tracing::info!("Layout iteration {iter}"); - let constraint = Constraint::new(); let mut provider = StabilityProvider::new(); + let constraint = <Introspector as Validate>::Constraint::new(); let mut vt = Vt { world, tracer: TrackedMut::reborrow_mut(&mut tracer), @@ -56,7 +56,7 @@ pub fn typeset( introspector = Introspector::new(&document.pages); - if iter >= 5 || introspector.valid(&constraint) { + if iter >= 5 || introspector.validate(&constraint) { break; } } @@ -69,7 +69,7 @@ pub fn typeset( /// Holds the state needed to [typeset] content. pub struct Vt<'a> { /// The compilation environment. - pub world: Tracked<'a, dyn World>, + pub world: Tracked<'a, dyn World + 'a>, /// The tracer for inspection of the values an expression produces. pub tracer: TrackedMut<'a, Tracer>, /// Provides stable identities to elements. |
