From 162070f6b7a5706fd36ac5de5b45d9e9ee02e4a4 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sun, 2 Apr 2023 14:31:48 -0400 Subject: [PATCH] ConfigBuilder::new can have different path types This removes the restriction to require all path params to be of the same path type. Just a minor nuisance. --- pb-rs/src/lib.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pb-rs/src/lib.rs b/pb-rs/src/lib.rs index 5c062d2..0139173 100644 --- a/pb-rs/src/lib.rs +++ b/pb-rs/src/lib.rs @@ -67,12 +67,18 @@ pub struct ConfigBuilder { } impl ConfigBuilder { - pub fn new>( - in_files: &[P], - output: Option<&P>, - output_dir: Option<&P>, - include_paths: &[P], - ) -> Result { + pub fn new( + in_files: &[P1], + output: Option<&P2>, + output_dir: Option<&P3>, + include_paths: &[P4], + ) -> Result + where + P1: AsRef, + P2: AsRef, + P3: AsRef, + P4: AsRef, + { let in_files = in_files .iter() .map(|f| f.as_ref().into())