Skip to content

Commit

Permalink
Fix type annotation for collection in parse_owned function
Browse files Browse the repository at this point in the history
    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
  • Loading branch information
Ben Racine committed Jul 3, 2024
1 parent aca5c36 commit 42be41a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion time/src/format_description/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn parse_owned<const VERSION: usize>(
let mut lexed = lexer::lex::<VERSION>(s.as_bytes());
let ast = ast::parse::<_, VERSION>(&mut lexed);
let format_items = format_item::parse(ast);
let items = format_items.collect::<Result<Box<_>, _>>()?;
let items: Box<_> = format_items.collect::<Result<Box<_>, _>>()?;
Ok(items.into())
}

Expand Down

0 comments on commit 42be41a

Please sign in to comment.