Skip to content

Commit

Permalink
Fix length type of FastApiOneByteString (denoland#1140)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Nov 30, 2022
1 parent 1bf74cc commit 0b9423a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fast_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ pub struct FastApiTypedArray<T: Default> {
#[repr(C)]
pub struct FastApiOneByteString {
data: *const u8,
pub length: usize,
pub length: u32,
}

impl FastApiOneByteString {
Expand All @@ -220,7 +220,7 @@ impl FastApiOneByteString {
unsafe {
std::str::from_utf8_unchecked(std::slice::from_raw_parts(
self.data,
self.length,
self.length as usize,
))
}
}
Expand Down

0 comments on commit 0b9423a

Please sign in to comment.