From df9a9caee0774559a52aa4382803adbd1cfbd1b5 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 7 Aug 2025 18:52:12 +0200 Subject: [PATCH] Fix return type of `missing_method` (#6718) --- crates/typst-eval/src/methods.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/typst-eval/src/methods.rs b/crates/typst-eval/src/methods.rs index 7cb36a00f..9b6d36153 100644 --- a/crates/typst-eval/src/methods.rs +++ b/crates/typst-eval/src/methods.rs @@ -1,5 +1,6 @@ //! Handles special built-in methods on values. +use ecow::{EcoString, eco_format}; use typst_library::diag::{At, SourceResult}; use typst_library::foundations::{Args, Str, Type, Value}; use typst_syntax::Span; @@ -86,6 +87,6 @@ pub(crate) fn call_method_access<'a>( /// The missing method error message. #[cold] -fn missing_method(ty: Type, method: &str) -> String { - format!("type {ty} has no method `{method}`") +fn missing_method(ty: Type, method: &str) -> EcoString { + eco_format!("type {ty} has no method `{method}`") }