summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-02-03 17:04:54 +0100
committerGitHub <noreply@github.com>2025-02-03 16:04:54 +0000
commiteee903b0f8d5c0dfda3539888d7473c6163841b0 (patch)
treed92b2f4565b0153c03cbb63575e2edd4e911e853 /crates/typst-library/src/lib.rs
parent12dbb012b19a29612fc863c558901200b4013f5d (diff)
Refactor `Scope` (#5797)
Diffstat (limited to 'crates/typst-library/src/lib.rs')
-rw-r--r--crates/typst-library/src/lib.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/typst-library/src/lib.rs b/crates/typst-library/src/lib.rs
index 22f3a62a..460321aa 100644
--- a/crates/typst-library/src/lib.rs
+++ b/crates/typst-library/src/lib.rs
@@ -33,7 +33,7 @@ use typst_syntax::{FileId, Source, Span};
use typst_utils::{LazyHash, SmallBitSet};
use crate::diag::FileResult;
-use crate::foundations::{Array, Bytes, Datetime, Dict, Module, Scope, Styles, Value};
+use crate::foundations::{Array, Binding, Bytes, Datetime, Dict, Module, Scope, Styles};
use crate::layout::{Alignment, Dir};
use crate::text::{Font, FontBook};
use crate::visualize::Color;
@@ -148,7 +148,7 @@ pub struct Library {
/// everything else configurable via set and show rules).
pub styles: Styles,
/// The standard library as a value. Used to provide the `std` variable.
- pub std: Value,
+ pub std: Binding,
/// In-development features that were enabled.
pub features: Features,
}
@@ -196,12 +196,11 @@ impl LibraryBuilder {
let math = math::module();
let inputs = self.inputs.unwrap_or_default();
let global = global(math.clone(), inputs, &self.features);
- let std = Value::Module(global.clone());
Library {
- global,
+ global: global.clone(),
math,
styles: Styles::new(),
- std,
+ std: Binding::detached(global),
features: self.features,
}
}