Change add_wrapped to take &impl Fn

This commit is contained in:
kngwyu 2019-06-14 12:42:32 +09:00
parent dfd5a2abb8
commit 8dbb388372
1 changed files with 1 additions and 1 deletions

View File

@ -192,7 +192,7 @@ impl PyModule {
/// ```rust,ignore
/// m.add("also_double", wrap_pyfunction!(double)(py));
/// ```
pub fn add_wrapped(&self, wrapper: &dyn Fn(Python) -> PyObject) -> PyResult<()> {
pub fn add_wrapped(&self, wrapper: &impl Fn(Python) -> PyObject) -> PyResult<()> {
let function = wrapper(self.py());
let name = function
.getattr(self.py(), "__name__")