diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-08-04 15:09:01 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-08-04 15:46:46 +0200 |
| commit | b8b0137504d388efbe2d1ba5082c0dcabcd8bc8a (patch) | |
| tree | 825abab07230c702bca8efee026d9b98ecfa2aae /crates/typst-cli/src | |
| parent | 028d2f53085022c39945b1a99c9dc78eb8069d4a (diff) | |
Bytes type
- Moves `Bytes` from `util` to `eval` module
- Accepts bytes in `str` function for bytes -> str conversion
- Adds `bytes` function for str | array -> bytes conversion
- Adds `array` function for bytes -> array conversion
- Adds `len`, `at`, and `slice` methods for bytes
- Adds `encoding` parameter to `read` function
Diffstat (limited to 'crates/typst-cli/src')
| -rw-r--r-- | crates/typst-cli/src/fonts.rs | 2 | ||||
| -rw-r--r-- | crates/typst-cli/src/world.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/typst-cli/src/fonts.rs b/crates/typst-cli/src/fonts.rs index 1b4757c8..3e89e0d6 100644 --- a/crates/typst-cli/src/fonts.rs +++ b/crates/typst-cli/src/fonts.rs @@ -5,8 +5,8 @@ use std::path::{Path, PathBuf}; use memmap2::Mmap; use typst::diag::StrResult; +use typst::eval::Bytes; use typst::font::{Font, FontBook, FontInfo, FontVariant}; -use typst::util::Bytes; use walkdir::WalkDir; use crate::args::FontsCommand; diff --git a/crates/typst-cli/src/world.rs b/crates/typst-cli/src/world.rs index 06a728a6..2c0ee7d0 100644 --- a/crates/typst-cli/src/world.rs +++ b/crates/typst-cli/src/world.rs @@ -9,10 +9,10 @@ use comemo::Prehashed; use same_file::Handle; use siphasher::sip128::{Hasher128, SipHasher13}; use typst::diag::{FileError, FileResult, StrResult}; -use typst::eval::{eco_format, Datetime, Library}; +use typst::eval::{eco_format, Bytes, Datetime, Library}; use typst::font::{Font, FontBook}; use typst::syntax::{FileId, Source}; -use typst::util::{Bytes, PathExt}; +use typst::util::PathExt; use typst::World; use crate::args::CompileCommand; |
