mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 16:01:02 +00:00
Use AsRef to accept paths in serde_codegen::expand
This commit is contained in:
@@ -37,10 +37,13 @@ include!(concat!(env!("OUT_DIR"), "/lib.rs"));
|
|||||||
include!("lib.rs.in");
|
include!("lib.rs.in");
|
||||||
|
|
||||||
#[cfg(feature = "with-syntex")]
|
#[cfg(feature = "with-syntex")]
|
||||||
pub fn expand(src: &Path, dst: &Path) -> io::Result<()> {
|
pub fn expand<S, D>(src: S, dst: D) -> io::Result<()>
|
||||||
|
where S: AsRef<Path>,
|
||||||
|
D: AsRef<Path>,
|
||||||
|
{
|
||||||
let mut registry = syntex::Registry::new();
|
let mut registry = syntex::Registry::new();
|
||||||
register(&mut registry);
|
register(&mut registry);
|
||||||
registry.expand("", src, dst)
|
registry.expand("", src.as_ref(), dst.as_ref())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "with-syntex")]
|
#[cfg(feature = "with-syntex")]
|
||||||
|
|||||||
Reference in New Issue
Block a user