Mercurial > hg
comparison rust/hg-cpython/src/revlog.rs @ 51194:f0fa98752d67
rust-index: remove `__setitem__` method from the mixed index
This is not defined on the Python or C one, and isn't used anywhere.
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 28 Jun 2023 11:59:43 +0200 |
parents | e79b0a4be3a7 |
children | f6403bcd9f96 |
comparison
equal
deleted
inserted
replaced
51193:e79b0a4be3a7 | 51194:f0fa98752d67 |
---|---|
273 let key = match key.extract::<i32>(py) { | 273 let key = match key.extract::<i32>(py) { |
274 Ok(rev) => rev.to_py_object(py).into_object(), | 274 Ok(rev) => rev.to_py_object(py).into_object(), |
275 Err(_) => key, | 275 Err(_) => key, |
276 }; | 276 }; |
277 self.cindex(py).borrow().inner().get_item(py, key) | 277 self.cindex(py).borrow().inner().get_item(py, key) |
278 } | |
279 | |
280 def __setitem__(&self, key: PyObject, value: PyObject) -> PyResult<()> { | |
281 self.cindex(py).borrow().inner().set_item(py, key, value) | |
282 } | 278 } |
283 | 279 |
284 def __contains__(&self, item: PyObject) -> PyResult<bool> { | 280 def __contains__(&self, item: PyObject) -> PyResult<bool> { |
285 // ObjectProtocol does not seem to provide contains(), so | 281 // ObjectProtocol does not seem to provide contains(), so |
286 // this is an equivalent implementation of the index_contains() | 282 // this is an equivalent implementation of the index_contains() |