summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/eval/array.rs16
-rw-r--r--crates/typst/src/eval/cast.rs1
-rw-r--r--crates/typst/src/eval/value.rs7
-rw-r--r--crates/typst/src/model/element.rs2
-rw-r--r--crates/typst/src/model/selector.rs6
5 files changed, 14 insertions, 18 deletions
diff --git a/crates/typst/src/eval/array.rs b/crates/typst/src/eval/array.rs
index 497f91b5..55e0cc69 100644
--- a/crates/typst/src/eval/array.rs
+++ b/crates/typst/src/eval/array.rs
@@ -738,14 +738,12 @@ impl Array {
vec.make_mut().sort_by(|a, b| {
// Until we get `try` blocks :)
match (key_of(a.clone()), key_of(b.clone())) {
- (Ok(a), Ok(b)) => {
- typst::eval::ops::compare(&a, &b).unwrap_or_else(|err| {
- if result.is_ok() {
- result = Err(err).at(span);
- }
- Ordering::Equal
- })
- }
+ (Ok(a), Ok(b)) => super::ops::compare(&a, &b).unwrap_or_else(|err| {
+ if result.is_ok() {
+ result = Err(err).at(span);
+ }
+ Ordering::Equal
+ }),
(Err(e), _) | (_, Err(e)) => {
if result.is_ok() {
result = Err(e);
@@ -794,7 +792,7 @@ impl Array {
}
for second in out.iter() {
- if typst::eval::ops::equal(&key, &key_of(second.clone())?) {
+ if super::ops::equal(&key, &key_of(second.clone())?) {
continue 'outer;
}
}
diff --git a/crates/typst/src/eval/cast.rs b/crates/typst/src/eval/cast.rs
index 4bb5b6af..0ba8535d 100644
--- a/crates/typst/src/eval/cast.rs
+++ b/crates/typst/src/eval/cast.rs
@@ -45,7 +45,6 @@ pub trait Reflect {
/// Produce an error message for an inacceptable value.
///
/// ```
- /// # use typst::eval::{Int, Reflect, Value};
/// assert_eq!(
/// <Int as Reflect>::error(Value::None),
/// "expected integer, found none",
diff --git a/crates/typst/src/eval/value.rs b/crates/typst/src/eval/value.rs
index a0b2645c..d4021415 100644
--- a/crates/typst/src/eval/value.rs
+++ b/crates/typst/src/eval/value.rs
@@ -9,13 +9,12 @@ use serde::de::value::{MapAccessDeserializer, SeqAccessDeserializer};
use serde::de::{Error, MapAccess, SeqAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use siphasher::sip128::{Hasher128, SipHasher13};
-use typst::eval::Duration;
use super::repr::{format_float, format_int_with_base};
use super::{
- fields, ops, Args, Array, AutoValue, Bytes, CastInfo, Content, Dict, FromValue, Func,
- IntoValue, Module, NativeType, NoneValue, Plugin, Reflect, Repr, Scope, Str, Symbol,
- Type, Version,
+ fields, ops, Args, Array, AutoValue, Bytes, CastInfo, Content, Dict, Duration,
+ FromValue, Func, IntoValue, Module, NativeType, NoneValue, Plugin, Reflect, Repr,
+ Scope, Str, Symbol, Type, Version,
};
use crate::diag::StrResult;
use crate::eval::{item, Datetime};
diff --git a/crates/typst/src/model/element.rs b/crates/typst/src/model/element.rs
index 4426ff31..7551f83b 100644
--- a/crates/typst/src/model/element.rs
+++ b/crates/typst/src/model/element.rs
@@ -219,7 +219,7 @@ pub trait NativeElement: Debug + Repr + Construct + Set + Send + Sync + 'static
fn set_label(&mut self, label: Label);
/// Set the element's label.
- fn labelled(mut self, label: ::typst::model::Label) -> Self
+ fn labelled(mut self, label: Label) -> Self
where
Self: Sized,
{
diff --git a/crates/typst/src/model/selector.rs b/crates/typst/src/model/selector.rs
index c71569e6..2159d84e 100644
--- a/crates/typst/src/model/selector.rs
+++ b/crates/typst/src/model/selector.rs
@@ -26,12 +26,12 @@ macro_rules! __select_where {
let mut fields = ::smallvec::SmallVec::new();
$(
fields.push((
- <$ty as ::typst::model::ElementFields>::Fields::$field as u8,
+ <$ty as $crate::model::ElementFields>::Fields::$field as u8,
$crate::eval::IntoValue::into_value($value),
));
)*
- ::typst::model::Selector::Elem(
- <$ty as ::typst::model::NativeElement>::elem(),
+ $crate::model::Selector::Elem(
+ <$ty as $crate::model::NativeElement>::elem(),
Some(fields),
)
}};