rust/hg-cpython/src/revlog.rs
changeset 51199 16d477bb0078
parent 51198 52bbb57a76ad
child 51200 7434747343ab
equal deleted inserted replaced
51198:52bbb57a76ad 51199:16d477bb0078
   216 
   216 
   217     /// return a binary packed version of the header
   217     /// return a binary packed version of the header
   218     def pack_header(&self, *args, **kw) -> PyResult<PyObject> {
   218     def pack_header(&self, *args, **kw) -> PyResult<PyObject> {
   219         let rindex = self.index(py).borrow();
   219         let rindex = self.index(py).borrow();
   220         let packed = rindex.pack_header(args.get_item(py, 0).extract(py)?);
   220         let packed = rindex.pack_header(args.get_item(py, 0).extract(py)?);
   221         let packed = PyBytes::new(py, &packed).into_object();
   221         let rust_res = PyBytes::new(py, &packed).into_object();
   222         let cpacked = self.call_cindex(py, "pack_header", args, kw)?;
   222 
   223         assert_py_eq(py, "pack_header", &packed, &cpacked)?;
   223         let c_res = self.call_cindex(py, "pack_header", args, kw)?;
   224         Ok(packed)
   224         assert_py_eq(py, "pack_header", &rust_res, &c_res)?;
       
   225         Ok(rust_res)
   225     }
   226     }
   226 
   227 
   227     /// get an index entry
   228     /// get an index entry
   228     def get(&self, *args, **kw) -> PyResult<PyObject> {
   229     def get(&self, *args, **kw) -> PyResult<PyObject> {
   229         self.call_cindex(py, "get", args, kw)
   230         self.call_cindex(py, "get", args, kw)