Skip to content

Relax bounds on Builder::compile_protos and Builder::compile_with_config #2433

@valkum

Description

@valkum

Feature Request

Crates

tonic-prost-build

Motivation

Before the split out, Builder::compile_protos and Builder::compile_with_config used impl AsRef<Path> for both arguments (protos and includes) which allowed you to pass a String to one arg and a PathBuf to another one, making the usage more ergonomic.

With the split into tonic-prost-build both arguments now share a single bound. There wasn't a reason given for this change.

Proposal

Change to

 pub fn compile_protos<P, I>(self, protos: &[P], includes: &[I]) -> io::Result<()>
    where
        P: AsRef<Path>,
        I: AsRef<Path>

Alternatives

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