rename `wrap_pyfunction` impl to `wrap_pyfunction_impl`

This commit is contained in:
David Hewitt 2023-01-19 08:51:44 +00:00
parent bed4f9d6ee
commit 89d4ae1dbf
3 changed files with 4 additions and 4 deletions

View File

@ -122,7 +122,7 @@ pub fn process_functions_in_module(
let name = &func.sig.ident;
let statements: Vec<syn::Stmt> = syn::parse_quote! {
#wrapped_function
#module_name.add_function(#krate::impl_::pyfunction::wrap_pyfunction(&#name::DEF, #module_name)?)?;
#module_name.add_function(#krate::impl_::pyfunction::wrap_pyfunction_impl(&#name::DEF, #module_name)?)?;
};
stmts.extend(statements);
}

View File

@ -2,7 +2,7 @@ use crate::{derive_utils::PyFunctionArguments, types::PyCFunction, PyResult};
pub use crate::impl_::pymethods::PyMethodDef;
pub fn wrap_pyfunction<'a>(
pub fn wrap_pyfunction_impl<'a>(
method_def: &PyMethodDef,
py_or_module: impl Into<PyFunctionArguments<'a>>,
) -> PyResult<&'a PyCFunction> {

View File

@ -125,12 +125,12 @@ macro_rules! wrap_pyfunction {
($function:path) => {
&|py_or_module| {
use $function as wrapped_pyfunction;
$crate::impl_::pyfunction::wrap_pyfunction(&wrapped_pyfunction::DEF, py_or_module)
$crate::impl_::pyfunction::wrap_pyfunction_impl(&wrapped_pyfunction::DEF, py_or_module)
}
};
($function:path, $py_or_module:expr) => {{
use $function as wrapped_pyfunction;
$crate::impl_::pyfunction::wrap_pyfunction(&wrapped_pyfunction::DEF, $py_or_module)
$crate::impl_::pyfunction::wrap_pyfunction_impl(&wrapped_pyfunction::DEF, $py_or_module)
}};
}