diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-11-08 23:42:34 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-11-08 23:42:45 +0100 |
| commit | 7f0fcda3764e261612021e5ec66d536bb5ee98ef (patch) | |
| tree | 496449a9a3111b2108a068087c56281b4d47e519 /crates/typst-library | |
| parent | d7fea7077ebe4df44edff32b2b3a6e4a00775974 (diff) | |
Move some things out of `util`
Diffstat (limited to 'crates/typst-library')
| -rw-r--r-- | crates/typst-library/src/lib.rs | 4 | ||||
| -rw-r--r-- | crates/typst-library/src/prelude.rs | 2 | ||||
| -rw-r--r-- | crates/typst-library/src/visualize/image.rs | 6 |
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. |
