diff --git a/prost-build/src/lib.rs b/prost-build/src/lib.rs
index 8beed55e6..6d150b753 100644
--- a/prost-build/src/lib.rs
+++ b/prost-build/src/lib.rs
@@ -698,10 +698,11 @@ impl Config {
/// Ok(())
/// }
/// ```
- pub fn compile_protos
(&mut self, protos: &[P], includes: &[P]) -> Result<()>
- where
- P: AsRef,
- {
+ pub fn compile_protos(
+ &mut self,
+ protos: &[impl AsRef],
+ includes: &[impl AsRef],
+ ) -> Result<()> {
let target: PathBuf = self.out_dir.clone().map(Ok).unwrap_or_else(|| {
env::var_os("OUT_DIR")
.ok_or_else(|| {
@@ -915,10 +916,7 @@ impl fmt::Debug for Config {
/// [2]: http://doc.crates.io/build-script.html#case-study-code-generation
/// [3]: https://developers.google.com/protocol-buffers/docs/proto3#importing-definitions
/// [4]: https://developers.google.com/protocol-buffers/docs/proto#packages
-pub fn compile_protos(protos: &[P], includes: &[P]) -> Result<()>
-where
- P: AsRef,
-{
+pub fn compile_protos(protos: &[impl AsRef], includes: &[impl AsRef]) -> Result<()> {
Config::new().compile_protos(protos, includes)
}
diff --git a/protobuf/build.rs b/protobuf/build.rs
index b0c5694d2..f296d9485 100644
--- a/protobuf/build.rs
+++ b/protobuf/build.rs
@@ -67,8 +67,7 @@ fn main() -> Result<()> {
.iter()
.map(|proto| datasets_include_dir.join(proto)),
);
- prost_build::compile_protos(&benchmark_protos, &[benchmarks_include_dir.to_path_buf()])
- .unwrap();
+ prost_build::compile_protos(&benchmark_protos, &[benchmarks_include_dir]).unwrap();
let conformance_include_dir = include_dir.join("conformance");
prost_build::compile_protos(
@@ -91,7 +90,7 @@ fn main() -> Result<()> {
test_includes.join("test_messages_proto3.proto"),
test_includes.join("unittest.proto"),
],
- &[include_dir.to_path_buf()],
+ &[include_dir],
)
.unwrap();
diff --git a/tests/src/bootstrap.rs b/tests/src/bootstrap.rs
index 0004e1efd..f50e583de 100644
--- a/tests/src/bootstrap.rs
+++ b/tests/src/bootstrap.rs
@@ -40,7 +40,7 @@ fn bootstrap() {
protobuf.join("timestamp.proto"),
protobuf.join("type.proto"),
],
- &[],
+ &[""],
)
.unwrap();