summaryrefslogtreecommitdiff
path: root/crates/typst-library
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-library')
-rw-r--r--crates/typst-library/src/lib.rs4
-rw-r--r--crates/typst-library/src/prelude.rs2
-rw-r--r--crates/typst-library/src/visualize/image.rs6
3 files changed, 5 insertions, 7 deletions
diff --git a/crates/typst-library/src/lib.rs b/crates/typst-library/src/lib.rs
index da31409a..554e7bcb 100644
--- a/crates/typst-library/src/lib.rs
+++ b/crates/typst-library/src/lib.rs
@@ -14,8 +14,8 @@ pub mod symbols;
pub mod text;
pub mod visualize;
-use typst::eval::{Array, LangItems, Library, Module, Scope};
-use typst::geom::{Align, Color, Dir, Smart};
+use typst::eval::{Array, LangItems, Library, Module, Scope, Smart};
+use typst::geom::{Align, Color, Dir};
use typst::model::{NativeElement, Styles};
use self::layout::LayoutRoot;
diff --git a/crates/typst-library/src/prelude.rs b/crates/typst-library/src/prelude.rs
index e3163e0f..00700540 100644
--- a/crates/typst-library/src/prelude.rs
+++ b/crates/typst-library/src/prelude.rs
@@ -18,7 +18,7 @@ pub use typst::doc::*;
#[doc(no_inline)]
pub use typst::eval::{
array, cast, dict, format_str, func, scope, ty, Args, Array, Bytes, Cast, Dict,
- FromValue, Func, IntoValue, Repr, Scope, Str, Symbol, Type, Value, Vm,
+ FromValue, Func, IntoValue, Repr, Scope, Smart, Str, Symbol, Type, Value, Vm,
};
#[doc(no_inline)]
pub use typst::geom::*;
diff --git a/crates/typst-library/src/visualize/image.rs b/crates/typst-library/src/visualize/image.rs
index 6e166bc0..7f0b8289 100644
--- a/crates/typst-library/src/visualize/image.rs
+++ b/crates/typst-library/src/visualize/image.rs
@@ -1,7 +1,5 @@
use std::ffi::OsStr;
-use std::path::Path;
-use typst::geom::{self, Smart};
use typst::image::{Image, ImageFormat, RasterFormat, VectorFormat};
use typst::util::option_eq;
@@ -135,7 +133,7 @@ impl Layout for ImageElem {
let format = match self.format(styles) {
Smart::Custom(v) => v,
Smart::Auto => {
- let ext = Path::new(self.path().as_str())
+ let ext = std::path::Path::new(self.path().as_str())
.extension()
.and_then(OsStr::to_str)
.unwrap_or_default()
@@ -213,7 +211,7 @@ impl Layout for ImageElem {
// Create a clipping group if only part of the image should be visible.
if fit == ImageFit::Cover && !target.fits(fitted) {
- frame.clip(geom::Path::rect(frame.size()));
+ frame.clip(Path::rect(frame.size()));
}
// Apply metadata.