Skip to content

Commit 0ea8bb3

Browse files
clean up
1 parent 20c17bf commit 0ea8bb3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/schema_traverse.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,14 @@ pub fn gather_schemas_for_cleaning<'py>(
170170
definitions: &Bound<'py, PyAny>,
171171
) -> PyResult<Bound<'py, PyDict>> {
172172
let py = schema.py();
173-
let schema_dict = schema.downcast_exact::<PyDict>()?;
174-
175173
let mut ctx = GatherCtx {
176174
definitions_dict: definitions.downcast_exact()?,
177-
def_refs: PyDict::new_bound(definitions.py()),
178-
recursive_def_refs: PySet::empty_bound(definitions.py())?,
179-
discriminators: PyList::empty_bound(definitions.py()),
175+
def_refs: PyDict::new_bound(py),
176+
recursive_def_refs: PySet::empty_bound(py)?,
177+
discriminators: PyList::empty_bound(py),
180178
recursively_seen_refs: HashSet::new(),
181179
};
182-
gather_schema(schema_dict, &mut ctx)?;
180+
gather_schema(schema.downcast_exact::<PyDict>()?, &mut ctx)?;
183181

184182
let res = PyDict::new_bound(py);
185183
res.set_item(intern!(py, "definition_refs"), ctx.def_refs)?;

0 commit comments

Comments
 (0)