@@ -58,12 +58,12 @@ pub fn license() -> &'static str {
5858}
5959
6060// XXX: use to_cstring when stable
61- fn from_path < P : AsRef < Path > > ( path : & P ) -> CString {
61+ fn from_path < P : AsRef < Path > + ? Sized > ( path : & P ) -> CString {
6262 CString :: new ( path. as_ref ( ) . as_os_str ( ) . to_str ( ) . unwrap ( ) ) . unwrap ( )
6363}
6464
6565// NOTE: this will be better with specialization or anonymous return types
66- pub fn open < P : AsRef < Path > > ( path : & P , format : & Format ) -> Result < Context , Error > {
66+ pub fn open < P : AsRef < Path > + ? Sized > ( path : & P , format : & Format ) -> Result < Context , Error > {
6767 unsafe {
6868 let mut ps = ptr:: null_mut ( ) ;
6969 let path = from_path ( path) ;
@@ -100,7 +100,7 @@ pub fn open<P: AsRef<Path>>(path: &P, format: &Format) -> Result<Context, Error>
100100 }
101101}
102102
103- pub fn open_with < P : AsRef < Path > > (
103+ pub fn open_with < P : AsRef < Path > + ? Sized > (
104104 path : & P ,
105105 format : & Format ,
106106 options : Dictionary ,
@@ -148,7 +148,7 @@ pub fn open_with<P: AsRef<Path>>(
148148 }
149149}
150150
151- pub fn input < P : AsRef < Path > > ( path : & P ) -> Result < context:: Input , Error > {
151+ pub fn input < P : AsRef < Path > + ? Sized > ( path : & P ) -> Result < context:: Input , Error > {
152152 unsafe {
153153 let mut ps = ptr:: null_mut ( ) ;
154154 let path = from_path ( path) ;
@@ -167,7 +167,7 @@ pub fn input<P: AsRef<Path>>(path: &P) -> Result<context::Input, Error> {
167167 }
168168}
169169
170- pub fn input_with_dictionary < P : AsRef < Path > > (
170+ pub fn input_with_dictionary < P : AsRef < Path > + ? Sized > (
171171 path : & P ,
172172 options : Dictionary ,
173173) -> Result < context:: Input , Error > {
@@ -193,7 +193,7 @@ pub fn input_with_dictionary<P: AsRef<Path>>(
193193 }
194194}
195195
196- pub fn input_with_interrupt < P : AsRef < Path > , F > (
196+ pub fn input_with_interrupt < P : AsRef < Path > + ? Sized , F > (
197197 path : & P ,
198198 closure : F ,
199199) -> Result < context:: Input , Error >
@@ -219,7 +219,7 @@ where
219219 }
220220}
221221
222- pub fn output < P : AsRef < Path > > ( path : & P ) -> Result < context:: Output , Error > {
222+ pub fn output < P : AsRef < Path > + ? Sized > ( path : & P ) -> Result < context:: Output , Error > {
223223 unsafe {
224224 let mut ps = ptr:: null_mut ( ) ;
225225 let path = from_path ( path) ;
@@ -235,7 +235,7 @@ pub fn output<P: AsRef<Path>>(path: &P) -> Result<context::Output, Error> {
235235 }
236236}
237237
238- pub fn output_with < P : AsRef < Path > > (
238+ pub fn output_with < P : AsRef < Path > + ? Sized > (
239239 path : & P ,
240240 options : Dictionary ,
241241) -> Result < context:: Output , Error > {
@@ -267,7 +267,10 @@ pub fn output_with<P: AsRef<Path>>(
267267 }
268268}
269269
270- pub fn output_as < P : AsRef < Path > > ( path : & P , format : & str ) -> Result < context:: Output , Error > {
270+ pub fn output_as < P : AsRef < Path > + ?Sized > (
271+ path : & P ,
272+ format : & str ,
273+ ) -> Result < context:: Output , Error > {
271274 unsafe {
272275 let mut ps = ptr:: null_mut ( ) ;
273276 let path = from_path ( path) ;
@@ -289,7 +292,7 @@ pub fn output_as<P: AsRef<Path>>(path: &P, format: &str) -> Result<context::Outp
289292 }
290293}
291294
292- pub fn output_as_with < P : AsRef < Path > > (
295+ pub fn output_as_with < P : AsRef < Path > + ? Sized > (
293296 path : & P ,
294297 format : & str ,
295298 options : Dictionary ,
0 commit comments