From ef96562ae91ff24648e4d450c7cd2bd6b8dd4197 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 20 Nov 2024 08:52:11 +0100 Subject: Merging upstream version 25.31.4. Signed-off-by: Daniel Baumann --- sqlglotrs/src/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sqlglotrs/src/lib.rs') diff --git a/sqlglotrs/src/lib.rs b/sqlglotrs/src/lib.rs index 43e90dc..e60620a 100644 --- a/sqlglotrs/src/lib.rs +++ b/sqlglotrs/src/lib.rs @@ -43,19 +43,19 @@ impl Token { ) -> Token { Python::with_gil(|py| Token { token_type, - token_type_py: PyNone::get(py).into(), - text: PyString::new(py, &text).into(), + token_type_py: PyNone::get_bound(py).into_py(py), + text: PyString::new_bound(py, &text).into_py(py), line, col, start, end, - comments: PyList::new(py, &comments).into(), + comments: PyList::new_bound(py, &comments).into(), }) } pub fn append_comments(&self, comments: &mut Vec) { Python::with_gil(|py| { - let pylist = self.comments.as_ref(py); + let pylist = self.comments.bind(py); for comment in comments.iter() { if let Err(_) = pylist.append(comment) { panic!("Failed to append comments to the Python list"); @@ -74,20 +74,20 @@ impl Token { Python::with_gil(|py| { Ok(format!( "", - self.token_type_py.as_ref(py).repr()?, - self.text.as_ref(py).repr()?, + self.token_type_py.bind(py).repr()?, + self.text.bind(py).repr()?, self.line, self.col, self.start, self.end, - self.comments.as_ref(py).repr()?, + self.comments.bind(py).repr()?, )) }) } } #[pymodule] -fn sqlglotrs(_py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn sqlglotrs(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_class::()?; m.add_class::()?; m.add_class::()?; -- cgit v1.2.3