tonic icon indicating copy to clipboard operation
tonic copied to clipboard

Relax bounds on `Builder::compile_protos` and `Builder::compile_with_config`

Open valkum opened this issue 2 months ago • 1 comments

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

valkum avatar Oct 21 '25 16:10 valkum

Sounds reasonable to me.

tottoto avatar Oct 25 '25 15:10 tottoto