summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-07-08 22:41:38 +0200
committerGitHub <noreply@github.com>2024-07-08 20:41:38 +0000
commit34990f7f0e25d51a76520edc1101df606013973f (patch)
tree2fbb696427db022f28eddac5690e133130f2e96b /crates
parentd1c7d08893ef293e74ac0763005e1dd3f46e6495 (diff)
Bump dependencies (#4523)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst-cli/Cargo.toml2
-rw-r--r--crates/typst/src/foundations/plugin.rs12
-rw-r--r--crates/typst/src/visualize/image/raster.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml
index 1bfd7358..7ada123c 100644
--- a/crates/typst-cli/Cargo.toml
+++ b/crates/typst-cli/Cargo.toml
@@ -53,7 +53,7 @@ tar = { workspace = true }
tempfile = { workspace = true }
toml = { workspace = true }
ureq = { workspace = true }
-xz2 = { workspace = true, optional = true, features = ["static"] }
+xz2 = { workspace = true, optional = true }
zip = { workspace = true, optional = true }
# Explicitly depend on OpenSSL if applicable, so that we can add the
diff --git a/crates/typst/src/foundations/plugin.rs b/crates/typst/src/foundations/plugin.rs
index 80644ea5..57dea827 100644
--- a/crates/typst/src/foundations/plugin.rs
+++ b/crates/typst/src/foundations/plugin.rs
@@ -234,12 +234,12 @@ impl Plugin {
let ty = func.ty(store.as_context());
// Check function signature.
- if ty.params().iter().any(|&v| v != wasmi::core::ValueType::I32) {
+ if ty.params().iter().any(|&v| v != wasmi::core::ValType::I32) {
bail!(
"plugin function `{name}` has a parameter that is not a 32-bit integer"
);
}
- if ty.results() != [wasmi::core::ValueType::I32] {
+ if ty.results() != [wasmi::core::ValType::I32] {
bail!("plugin function `{name}` does not return exactly one 32-bit integer");
}
@@ -257,14 +257,14 @@ impl Plugin {
// Collect the lengths of the argument buffers.
let lengths = args
.iter()
- .map(|a| wasmi::Value::I32(a.len() as i32))
+ .map(|a| wasmi::Val::I32(a.len() as i32))
.collect::<Vec<_>>();
// Store the input data.
store.data_mut().args = args;
// Call the function.
- let mut code = wasmi::Value::I32(-1);
+ let mut code = wasmi::Val::I32(-1);
func.call(store.as_context_mut(), &lengths, std::slice::from_mut(&mut code))
.map_err(|err| eco_format!("plugin panicked: {err}"))?;
if let Some(MemoryError { offset, length, write }) =
@@ -281,8 +281,8 @@ impl Plugin {
// Parse the functions return value.
match code {
- wasmi::Value::I32(0) => {}
- wasmi::Value::I32(1) => match std::str::from_utf8(&output) {
+ wasmi::Val::I32(0) => {}
+ wasmi::Val::I32(1) => match std::str::from_utf8(&output) {
Ok(message) => bail!("plugin errored with: {message}"),
Err(_) => {
bail!("plugin errored, but did not return a valid error message")
diff --git a/crates/typst/src/visualize/image/raster.rs b/crates/typst/src/visualize/image/raster.rs
index 995e3483..ff15432b 100644
--- a/crates/typst/src/visualize/image/raster.rs
+++ b/crates/typst/src/visualize/image/raster.rs
@@ -30,11 +30,11 @@ impl RasterImage {
/// Decode a raster image.
#[comemo::memoize]
pub fn new(data: Bytes, format: RasterFormat) -> StrResult<RasterImage> {
- fn decode_with<'a, T: ImageDecoder<'a>>(
+ fn decode_with<T: ImageDecoder>(
decoder: ImageResult<T>,
) -> ImageResult<(image::DynamicImage, Option<Vec<u8>>)> {
let mut decoder = decoder?;
- let icc = decoder.icc_profile().filter(|icc| !icc.is_empty());
+ let icc = decoder.icc_profile().ok().flatten().filter(|icc| !icc.is_empty());
decoder.set_limits(Limits::default())?;
let dynamic = image::DynamicImage::from_decoder(decoder)?;
Ok((dynamic, icc))