> +    def __contains__(&self, item: PyObject) -> PyResult<bool> {
> +        Ok(self
> +            .dirs_map(py)
> +            .borrow()
> +            .get(&item.extract::<PyBytes>(py)?.data(py).to_owned())
> +            .is_some())

`.contains_key(..)` and `.as_ref()` instead of `&...to_owned()`.

I'm surprised by the use of Deref in the previous patch. Is it legit
to leverage Deref to expose the inner type?
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to