Skip to content

TemplateParameters' methods should just return a Vec, not an Option<Vec> #960

Closed
@fitzgen

Description

@fitzgen

I thought that the Option would be useful, but in practice we do pretty much ignore that it is an option and do things like params.unwrap_or(vec![]). And then in other places when the result is Some we assume that the contained Vec is not empty, when that isn't always the case.

It will be much simpler to just return a Vec that is either empty or not.

And also usize instead of Option<usize> for num_self_template_params.

The trait's comment will need to be updated as well.

https://github.com/rust-lang-nursery/rust-bindgen/blob/cd41e5cfe26555af574e81b6aa3bed2b84a18000/src/ir/template.rs#L102

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions