From 42be41ac3330277b0c4739849189696f0dc53e75 Mon Sep 17 00:00:00 2001 From: Ben Racine Date: Tue, 2 Jul 2024 21:32:40 -0500 Subject: [PATCH] Fix type annotation for collection in parse_owned function Explicitly annotate the type of items collected from format_items to resolve compiler error E0282. The type Box<_> ensures correct inference of the boxed collection type. This resolves issues encountered during compilation with Ferrocene. Closes: #689 --- time/src/format_description/parse/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/src/format_description/parse/mod.rs b/time/src/format_description/parse/mod.rs index 602ecf71f..c4cd1474b 100644 --- a/time/src/format_description/parse/mod.rs +++ b/time/src/format_description/parse/mod.rs @@ -80,7 +80,7 @@ pub fn parse_owned( let mut lexed = lexer::lex::(s.as_bytes()); let ast = ast::parse::<_, VERSION>(&mut lexed); let format_items = format_item::parse(ast); - let items = format_items.collect::, _>>()?; + let items: Box<_> = format_items.collect::, _>>()?; Ok(items.into()) }