mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 02:28:00 +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");
|
||||
|
||||
#[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();
|
||||
register(&mut registry);
|
||||
registry.expand("", src, dst)
|
||||
registry.expand("", src.as_ref(), dst.as_ref())
|
||||
}
|
||||
|
||||
#[cfg(feature = "with-syntex")]
|
||||
|
||||
Reference in New Issue
Block a user