diff --git a/Cargo.lock b/Cargo.lock index 0379b21..aa45daf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "ariadne" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72fe02fc62033df9ba41cba57ee19acf5e742511a140c7dbc3a873e19a19a1bd" +checksum = "dd002a6223f12c7a95cdd4b1cb3a0149d22d37f7a9ecdb2cb691a071fe236c29" dependencies = [ "unicode-width", "yansi", @@ -233,9 +233,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.15.4" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", @@ -307,11 +307,11 @@ dependencies = [ [[package]] name = "citationberg" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15a0bf8014b266d11f20451dc9202d8d26180ffd8b094d73ecbe74d821f01fb" +checksum = "82108f2b676c954076d2e5044f19a6a03887b24bd42804f322e0650d13035899" dependencies = [ - "quick-xml 0.28.2", + "quick-xml", "serde", ] @@ -329,19 +329,21 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "comemo" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf5705468fa80602ee6a5f9318306e6c428bffd53e43209a78bc05e6e667c6f4" +checksum = "df6916408a724339aa77b18214233355f3eb04c42eb895e5f8909215bd8a7a91" dependencies = [ "comemo-macros", + "once_cell", + "parking_lot", "siphasher 1.0.0", ] [[package]] name = "comemo-macros" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54af6ac68ada2d161fa9cc1ab52676228e340866d094d6542107e74b82acc095" +checksum = "c8936e42f9b4f5bdfaf23700609ac1f11cb03ad4c1ec128a4ee4fd0903e228db" dependencies = [ "proc-macro2", "quote", @@ -624,9 +626,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fallible-streaming-iterator" @@ -695,14 +697,14 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fontdb" -version = "0.15.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020e203f177c0fb250fb19455a252e838d2bbbce1f80f25ecc42402aafa8cd38" +checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3" dependencies = [ "log", "slotmap", "tinyvec", - "ttf-parser 0.19.2", + "ttf-parser", ] [[package]] @@ -874,18 +876,18 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "692eaaf7f7607518dd3cef090f1474b61edc5301d8012f09579920df68b725ee" dependencies = [ "hashbrown", ] [[package]] name = "hayagriva" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9f97c07366b7f686741521ca63cc14baf18cea53c39b0c09873cd1d4a1b2b8c" +checksum = "cc2e670de5191df083ddd112cd253049f8213277ccf0c15e18a8bf10e6c666cc" dependencies = [ "biblatex", "ciborium", @@ -1150,6 +1152,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "if_chain" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" + [[package]] name = "image" version = "0.24.7" @@ -1166,6 +1174,18 @@ dependencies = [ "png", ] +[[package]] +name = "image" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9b4f005360d32e9325029b38ba47ebd7a56f3316df09249368939562d518645" +dependencies = [ + "bytemuck", + "byteorder", + "num-traits", + "png", +] + [[package]] name = "imagesize" version = "0.12.0" @@ -1216,6 +1236,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kamadak-exif" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4fc70d0ab7e5b6bafa30216a6b48705ea964cdfc29c050f2412295eba58077" +dependencies = [ + "mutate_once", +] + [[package]] name = "kurbo" version = "0.9.5" @@ -1239,9 +1268,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libsqlite3-sys" -version = "0.26.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +checksum = "0c10584274047cb335c23d3e61bcef8e323adae7c5c8c760540f73610177fc3f" dependencies = [ "cc", "pkg-config", @@ -1350,6 +1379,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "mutate_once" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" + [[package]] name = "num-bigint" version = "0.4.4" @@ -1470,6 +1505,48 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher 0.3.11", +] + [[package]] name = "pico-args" version = "0.5.0" @@ -1490,11 +1567,11 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pixglyph" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67591f21f6668e63c1cd85adab066ac8a92bc7b962668dd8042197a6e4b8f8f" +checksum = "e2e0f8ad4c197db38125b880c3c44544788665c7d5f4c42f5a35da44bca1a712" dependencies = [ - "ttf-parser 0.19.2", + "ttf-parser", ] [[package]] @@ -1512,7 +1589,7 @@ dependencies = [ "base64", "indexmap", "line-wrap", - "quick-xml 0.31.0", + "quick-xml", "serde", "time", ] @@ -1557,6 +1634,12 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "portable-atomic" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + [[package]] name = "postcard" version = "1.0.8" @@ -1606,14 +1689,10 @@ dependencies = [ ] [[package]] -name = "quick-xml" -version = "0.28.2" +name = "qcms" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" -dependencies = [ - "memchr", - "serde", -] +checksum = "edecfcd5d755a5e5d98e24cf43113e7cdaec5a070edd0f6b250c03a573da30fa" [[package]] name = "quick-xml" @@ -1622,6 +1701,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", + "serde", ] [[package]] @@ -1683,12 +1763,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rctree" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" - [[package]] name = "redox_syscall" version = "0.3.5" @@ -1787,9 +1861,9 @@ dependencies = [ [[package]] name = "resvg" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7980f653f9a7db31acff916a262c3b78c562919263edea29bf41a056e20497" +checksum = "5c34501046959e06470ba62a2dc7f31c15f94ac250d842a45f9e012f4ee40c1e" dependencies = [ "gif", "jpeg-decoder", @@ -1827,18 +1901,15 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302" -dependencies = [ - "xmlparser", -] +checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" [[package]] name = "rusqlite" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" +checksum = "b838eba278d213a8beaf485bd313fd580ca4505a00d5871caeb1457c55322cae" dependencies = [ "bitflags 2.4.1", "fallible-iterator", @@ -1893,14 +1964,14 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "rustybuzz" -version = "0.10.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71cd15fef9112a1f94ac64b58d1e4628192631ad6af4dc69997f995459c874e7" +checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "bytemuck", "smallvec", - "ttf-parser 0.19.2", + "ttf-parser", "unicode-bidi-mirroring", "unicode-ccc", "unicode-properties", @@ -2213,9 +2284,9 @@ dependencies = [ [[package]] name = "svgtypes" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71499ff2d42f59d26edb21369a308ede691421f79ebc0f001e2b1fd3a7c9e52" +checksum = "6e44e288cd960318917cbd540340968b90becc8bc81f171345d706e7a89d9d70" dependencies = [ "kurbo", "siphasher 0.3.11", @@ -2555,15 +2626,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "ttf-parser" -version = "0.18.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" - -[[package]] -name = "ttf-parser" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] name = "tungstenite" @@ -2585,6 +2650,17 @@ dependencies = [ "utf-8", ] +[[package]] +name = "two-face" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37bed2135b2459c7eefba72c906d374697eb15949c205f2f124e3636a46b5eeb" +dependencies = [ + "once_cell", + "serde", + "syntect", +] + [[package]] name = "typed-arena" version = "2.0.2" @@ -2605,8 +2681,8 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typst" -version = "0.10.0" -source = "git+https://github.com/typst/typst?rev=70ca0d257bb4ba927f63260e20443f244e0bb58c#70ca0d257bb4ba927f63260e20443f244e0bb58c" +version = "0.11.0" +source = "git+https://github.com/typst/typst?rev=v0.11.0#2bf9f95dd83f2ceef1e32ae1847a162c7d193f76" dependencies = [ "az", "bitflags 2.4.1", @@ -2623,13 +2699,19 @@ dependencies = [ "icu_provider_adapters", "icu_provider_blob", "icu_segmenter", - "image", + "if_chain", + "image 0.24.7", "indexmap", + "kamadak-exif", "kurbo", "lipsum", "log", "once_cell", "palette", + "phf", + "png", + "portable-atomic", + "qcms", "rayon", "regex", "roxmltree", @@ -2643,11 +2725,13 @@ dependencies = [ "syntect", "time", "toml", - "tracing", - "ttf-parser 0.19.2", + "ttf-parser", + "two-face", "typed-arena", + "typst-assets", "typst-macros", "typst-syntax", + "typst-timing", "unicode-bidi", "unicode-math-class", "unicode-script", @@ -2656,6 +2740,12 @@ dependencies = [ "wasmi", ] +[[package]] +name = "typst-assets" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f13f85360328da54847dd7fefaf272dfa5b6d1fdeb53f32938924c39bf5b2c6c" + [[package]] name = "typst-bot" version = "0.1.0" @@ -2676,8 +2766,8 @@ dependencies = [ [[package]] name = "typst-macros" -version = "0.10.0" -source = "git+https://github.com/typst/typst?rev=70ca0d257bb4ba927f63260e20443f244e0bb58c#70ca0d257bb4ba927f63260e20443f244e0bb58c" +version = "0.11.0" +source = "git+https://github.com/typst/typst?rev=v0.11.0#2bf9f95dd83f2ceef1e32ae1847a162c7d193f76" dependencies = [ "heck", "proc-macro2", @@ -2687,32 +2777,33 @@ dependencies = [ [[package]] name = "typst-render" -version = "0.10.0" -source = "git+https://github.com/typst/typst?rev=70ca0d257bb4ba927f63260e20443f244e0bb58c#70ca0d257bb4ba927f63260e20443f244e0bb58c" +version = "0.11.0" +source = "git+https://github.com/typst/typst?rev=v0.11.0#2bf9f95dd83f2ceef1e32ae1847a162c7d193f76" dependencies = [ "bytemuck", "comemo", "flate2", - "image", + "image 0.24.7", "pixglyph", "resvg", "roxmltree", "tiny-skia", - "ttf-parser 0.19.2", + "ttf-parser", "typst", + "typst-macros", + "typst-timing", "usvg", ] [[package]] name = "typst-syntax" -version = "0.10.0" -source = "git+https://github.com/typst/typst?rev=70ca0d257bb4ba927f63260e20443f244e0bb58c#70ca0d257bb4ba927f63260e20443f244e0bb58c" +version = "0.11.0" +source = "git+https://github.com/typst/typst?rev=v0.11.0#2bf9f95dd83f2ceef1e32ae1847a162c7d193f76" dependencies = [ "comemo", "ecow", "once_cell", "serde", - "tracing", "unicode-ident", "unicode-math-class", "unicode-script", @@ -2720,6 +2811,17 @@ dependencies = [ "unscanny", ] +[[package]] +name = "typst-timing" +version = "0.11.0" +source = "git+https://github.com/typst/typst?rev=v0.11.0#2bf9f95dd83f2ceef1e32ae1847a162c7d193f76" +dependencies = [ + "parking_lot", + "serde", + "serde_json", + "typst-syntax", +] + [[package]] name = "unic-langid" version = "0.9.1" @@ -2871,9 +2973,9 @@ dependencies = [ [[package]] name = "usvg" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51daa774fe9ee5efcf7b4fec13019b8119cda764d9a8b5b06df02bb1445c656" +checksum = "377f62b4a3c173de8654c1aa80ab1dac1154e6f13a779a9943e53780120d1625" dependencies = [ "base64", "log", @@ -2886,9 +2988,9 @@ dependencies = [ [[package]] name = "usvg-parser" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c88a5ffaa338f0e978ecf3d4e00d8f9f493e29bed0752e1a808a1db16afc40" +checksum = "351a05e6f2023d6b4e946f734240a3927aefdcf930d7d42587a2c8a8869814b0" dependencies = [ "data-url", "flate2", @@ -2904,9 +3006,9 @@ dependencies = [ [[package]] name = "usvg-text-layout" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2374378cb7a3fb8f33894e0fdb8625e1bbc4f25312db8d91f862130b541593" +checksum = "8c41888b9d5cf431fe852eaf9d047bbde83251b98f1749c2f08b1071e6db46e2" dependencies = [ "fontdb", "kurbo", @@ -2920,11 +3022,10 @@ dependencies = [ [[package]] name = "usvg-tree" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cacb0c5edeaf3e80e5afcf5b0d4004cc1d36318befc9a7c6606507e5d0f4062" +checksum = "18863e0404ed153d6e56362c5b1146db9f4f262a3244e3cf2dbe7d8a85909f05" dependencies = [ - "rctree", "strict-num", "svgtypes", "tiny-skia-path", @@ -3271,12 +3372,12 @@ dependencies = [ "bytemuck", "cargo_metadata", "comemo", - "image", + "image 0.25.0", "protocol", "tar", "thiserror", "time", - "ttf-parser 0.18.1", + "ttf-parser", "typst", "typst-render", "ureq", @@ -3298,12 +3399,6 @@ dependencies = [ "libc", ] -[[package]] -name = "xmlparser" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" - [[package]] name = "xmlwriter" version = "0.1.0" diff --git a/bot/Cargo.toml b/bot/Cargo.toml index a931039..489a72e 100644 --- a/bot/Cargo.toml +++ b/bot/Cargo.toml @@ -11,7 +11,7 @@ poise = { version = "0.6", git = "https://github.com/serenity-rs/poise", default "cache", ] } protocol = { path = "../protocol" } -rusqlite = { version = "0.29", features = ["bundled"] } +rusqlite = { version = "0.31", features = ["bundled"] } serde = { version = "1", features = ["derive"] } serenity = { version = "0.12", default_features = false, features = [ "rustls_backend", diff --git a/worker/Cargo.toml b/worker/Cargo.toml index 7337859..cfbc51e 100644 --- a/worker/Cargo.toml +++ b/worker/Cargo.toml @@ -4,17 +4,17 @@ name = "worker" version = "0.1.0" [dependencies] -ariadne = { version = "0.3", default_features = false } +ariadne = { version = "0.4", default_features = false } bincode = "1" bytemuck = "1" -comemo = "0.3" -image = { version = "0.24", default_features = false, features = ["png"] } +comemo = "0.4" +image = { version = "0.25", default_features = false, features = ["png"] } protocol = { path = "../protocol" } thiserror = "1" time = "0.3" -ttf-parser = "0.18" -typst = { git = "https://github.com/typst/typst", rev = "70ca0d257bb4ba927f63260e20443f244e0bb58c" } -typst-render = { git = "https://github.com/typst/typst", rev = "70ca0d257bb4ba927f63260e20443f244e0bb58c" } +ttf-parser = "0.20" +typst = { git = "https://github.com/typst/typst", rev = "v0.11.0" } +typst-render = { git = "https://github.com/typst/typst", rev = "v0.11.0" } # downloading packages zune-inflate = { version = "0.2", default_features = false, features = [ @@ -25,4 +25,4 @@ tar = "0.4" ureq = "2" [build-dependencies] -cargo_metadata = "0.15" +cargo_metadata = "0.18" diff --git a/worker/src/diagnostic.rs b/worker/src/diagnostic.rs index 8d73d5d..7085a2f 100644 --- a/worker/src/diagnostic.rs +++ b/worker/src/diagnostic.rs @@ -156,6 +156,8 @@ impl<'a> SourceCache<'a> { } impl Cache for SourceCache<'_> { + type Storage = String; + fn fetch(&mut self, id: &FileId) -> Result<&ariadne::Source, Box> { let source = match self.cache.entry(*id) { Entry::Occupied(entry) => entry.into_mut(), @@ -164,7 +166,7 @@ impl Cache for SourceCache<'_> { .sandbox .source(*id) .map_err(|error| Box::new(error) as Box)?; - let source = ariadne::Source::from(source.text()); + let source = ariadne::Source::from(source.text().to_owned()); entry.insert(source) } }; @@ -206,7 +208,7 @@ pub fn format_diagnostics(sandbox: &WithSource, diagnostics: &[SourceDiagnostic] let mut bytes = Vec::new(); - let mut diagnostics = diagnostics.into_iter(); + let mut diagnostics = diagnostics.iter(); while let Some(diagnostic) = diagnostics.next() { let typst_span = diagnostic.span; let span = typst_span.id().map(|file_id| { diff --git a/worker/src/render.rs b/worker/src/render.rs index 368d1d4..527b06d 100644 --- a/worker/src/render.rs +++ b/worker/src/render.rs @@ -61,7 +61,8 @@ pub fn render(sandbox: &Sandbox, source: String) -> Result { let frame = &document .pages .first() - .ok_or("no pages in rendered output")?; + .ok_or("no pages in rendered output")? + .frame; let more_pages = NonZeroUsize::new(document.pages.len().saturating_sub(1)); let pixels_per_point = determine_pixels_per_point(frame.size()).map_err(to_string)?; diff --git a/worker/src/sandbox.rs b/worker/src/sandbox.rs index 00a96f9..7b88c83 100644 --- a/worker/src/sandbox.rs +++ b/worker/src/sandbox.rs @@ -5,7 +5,8 @@ use std::path::PathBuf; use comemo::Prehashed; use typst::diag::{eco_format, FileError, FileResult, PackageError, PackageResult}; use typst::foundations::{Bytes, Datetime}; -use typst::syntax::{FileId, PackageSpec, Source}; +use typst::syntax::package::PackageSpec; +use typst::syntax::{FileId, Source}; use typst::text::{Font, FontBook}; use typst::Library; @@ -90,7 +91,7 @@ impl Sandbox { let fonts = fonts(); Self { - library: Prehashed::new(Library::build()), + library: Prehashed::new(Library::builder().build()), book: Prehashed::new(FontBook::from_fonts(&fonts)), fonts,