Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): split path types in compile #721

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions tonic-build/src/prost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,24 +368,22 @@ impl Builder {
}

/// Compile the .proto files and execute code generation.
pub fn compile<P>(self, protos: &[P], includes: &[P]) -> io::Result<()>
where
P: AsRef<Path>,
{
pub fn compile(
self,
protos: &[impl AsRef<Path>],
includes: &[impl AsRef<Path>],
) -> 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<P>(
pub fn compile_with_config(
self,
mut config: Config,
protos: &[P],
includes: &[P],
) -> io::Result<()>
where
P: AsRef<Path>,
{
protos: &[impl AsRef<Path>],
includes: &[impl AsRef<Path>],
) -> io::Result<()> {
let out_dir = if let Some(out_dir) = self.out_dir.as_ref() {
out_dir.clone()
} else {
Expand Down