Skip to content

Type arguments to compose are horrendous #235

@dhdaines

Description

@dhdaines

Not sure if this is rusfst's fault or something inherent to the Rust language, but I really don't feel like it should be necessary to write a straightforward compose operation this way (https://github.com/dhdaines/rustfst-g2p/blob/main/src/g2p.rs#L148):

// fst and self.model are both VectorFst<TropicalWeight>
let fst: VectorFst<TropicalWeight> = compose::<
    TropicalWeight,
    VectorFst<TropicalWeight>,
    VectorFst<TropicalWeight>,
    _,
    _,
    _,
>(fst, &self.model)?;

Is there something that can be done to make rustc properly infer types W, F1, and F2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions