Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Mar 20, 2024
1 parent 04ba564 commit 31b76b1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,16 @@ fn decode_dag_cbor_to_pyobject<R: Read + Seek>(
}
}

let key_py = string_new_bound(py, key.as_slice()).to_object(py);
let key_py = string_new_bound(py, key.as_slice());
prev_key = Some(key);

let value = decode_dag_cbor_to_pyobject(py, r, deep + 1)?;
dict.set_item(key_py, value).unwrap();
// dict.set_item(key_py, value).unwrap();

// TODO(MarshalX): add error check
unsafe {
ffi::PyDict_SetItem(dict.as_ptr(), key_py.as_ptr(), value.as_ptr());
}
}

dict.to_object(py)
Expand Down

0 comments on commit 31b76b1

Please sign in to comment.