From 53ecc1f85e7f7eeb0dce4ab23432d6c36d8a46b0 Mon Sep 17 00:00:00 2001 From: LOU Xun Date: Wed, 20 Oct 2021 14:46:28 +0000 Subject: [PATCH] fix(build): split path types in compile (#721) BREAKING: Build paths now accept two different types --- tonic-build/src/prost.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tonic-build/src/prost.rs b/tonic-build/src/prost.rs index 2a346f3..108cf80 100644 --- a/tonic-build/src/prost.rs +++ b/tonic-build/src/prost.rs @@ -381,24 +381,22 @@ impl Builder { } /// Compile the .proto files and execute code generation. - pub fn compile

(self, protos: &[P], includes: &[P]) -> io::Result<()> - where - P: AsRef, - { + pub fn compile( + self, + protos: &[impl AsRef], + includes: &[impl AsRef], + ) -> io::Result<()> { self.compile_with_config(Config::new(), protos, includes) } /// Compile the .proto files and execute code generation using a /// custom `prost_build::Config`. - pub fn compile_with_config

( + pub fn compile_with_config( self, mut config: Config, - protos: &[P], - includes: &[P], - ) -> io::Result<()> - where - P: AsRef, - { + protos: &[impl AsRef], + includes: &[impl AsRef], + ) -> io::Result<()> { let out_dir = if let Some(out_dir) = self.out_dir.as_ref() { out_dir.clone() } else {