Skip to content

Commit a1e0a55

Browse files
Add TryInto impl
1 parent 9546843 commit a1e0a55

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/fmt.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ impl<'py> IntoPyObject<'py> for PyUnicodeWriter<'py> {
137137
}
138138
}
139139

140+
#[cfg(Py_3_14)]
141+
impl<'py> TryInto<Bound<'py, PyString>> for PyUnicodeWriter<'py> {
142+
type Error = PyErr;
143+
144+
fn try_into(self) -> PyResult<Bound<'py, PyString>> {
145+
self.into_py_string()
146+
}
147+
}
148+
140149
#[cfg(test)]
141150
mod tests {
142151
#[cfg(Py_3_14)]

0 commit comments

Comments
 (0)