Skip to content

Commit

Permalink
fix: builtin bytes type missing (#129)
Browse files Browse the repository at this point in the history
According to pyo3's
[documentation](https://pyo3.rs/v0.23.3/conversions/tables.html#returning-rust-values-to-python),
`Cow<[u8]>` in Rust is Python's `bytes` type, but this mapping is
currently not implemented in the crate.

Co-authored-by: Hiromi Ishii <[email protected]>
  • Loading branch information
Leeeon233 and konn authored Jan 6, 2025
1 parent dd7bf37 commit e4533b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyo3-stub-gen/src/stub_type/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl_builtin!(String, "str");
impl_builtin!(OsString, "str");
impl_builtin!(Cow<'_, str>, "str");
impl_builtin!(Cow<'_, OsStr>, "str");
impl_builtin!(Cow<'_, [u8]>, "bytes");

impl PyStubType for PathBuf {
fn type_output() -> TypeInfo {
Expand Down

0 comments on commit e4533b7

Please sign in to comment.