Rust - Add len() and is_empty() on Encoding

This commit is contained in:
Anthony MOI
2020-04-24 11:44:10 -04:00
parent 9d75e38cc9
commit 7d2b59b0aa
2 changed files with 9 additions and 1 deletions

View File

@ -32,7 +32,7 @@ impl PyObjectProtocol for Encoding {
#[pyproto]
impl PySequenceProtocol for Encoding {
fn __len__(self) -> PyResult<usize> {
Ok(self.encoding.get_ids().len())
Ok(self.encoding.len())
}
}