diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-19 10:19:24 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-19 10:19:34 +0100 |
| commit | 0ba99ab8aa523645e2f0a0d9f6333ad4e48f5daa (patch) | |
| tree | 2de7ce344b6d579dca8ae346c68b1931a6e79b25 /src/model/content.rs | |
| parent | c7f4d6b12ee3138c752402889eeaa603ac69351d (diff) | |
Measurement and introspection rework
Diffstat (limited to 'src/model/content.rs')
| -rw-r--r-- | src/model/content.rs | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/model/content.rs b/src/model/content.rs index 3c661929..5317236e 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -2,7 +2,6 @@ use std::any::TypeId; use std::fmt::{self, Debug, Formatter, Write}; use std::hash::{Hash, Hasher}; use std::iter::{self, Sum}; -use std::num::NonZeroUsize; use std::ops::{Add, AddAssign, Deref}; use ecow::{eco_format, EcoString, EcoVec}; @@ -10,10 +9,10 @@ use once_cell::sync::Lazy; use super::{ node, Behave, Behaviour, Fold, Guard, Locatable, Recipe, StableId, Style, StyleMap, - Synthesize, Vt, + Synthesize, }; use crate::diag::{SourceResult, StrResult}; -use crate::doc::{Location, Meta}; +use crate::doc::Meta; use crate::eval::{ cast_from_value, cast_to_value, Args, Cast, Func, FuncInfo, Str, Value, Vm, }; @@ -186,22 +185,6 @@ impl Content { self.field(field).ok_or_else(|| missing_field(field)) } - /// Determine the page of this content. - pub fn page(&self, vt: &Vt) -> StrResult<NonZeroUsize> { - match self.stable_id() { - Some(id) => Ok(vt.introspector.page(id)), - None => Err("this method can only be called on queried content".into()), - } - } - - /// Determine the location of this content. - pub fn location(&self, vt: &Vt) -> StrResult<Location> { - match self.stable_id() { - Some(id) => Ok(vt.introspector.location(id)), - None => Err("this method can only be called on queried content".into()), - } - } - /// The content's label. pub fn label(&self) -> Option<&Label> { match self.field("label")? { |
