Skip to content

Commit 31b76b1

Browse files
committed
fix imports
1 parent 04ba564 commit 31b76b1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,16 @@ fn decode_dag_cbor_to_pyobject<R: Read + Seek>(
159159
}
160160
}
161161

162-
let key_py = string_new_bound(py, key.as_slice()).to_object(py);
162+
let key_py = string_new_bound(py, key.as_slice());
163163
prev_key = Some(key);
164164

165165
let value = decode_dag_cbor_to_pyobject(py, r, deep + 1)?;
166-
dict.set_item(key_py, value).unwrap();
166+
// dict.set_item(key_py, value).unwrap();
167+
168+
// TODO(MarshalX): add error check
169+
unsafe {
170+
ffi::PyDict_SetItem(dict.as_ptr(), key_py.as_ptr(), value.as_ptr());
171+
}
167172
}
168173

169174
dict.to_object(py)

0 commit comments

Comments
 (0)