0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2025-01-21 21:50:20 -05:00

Fix length type of FastApiOneByteString (#1140)

This commit is contained in:
Divy Srivastava 2022-11-30 06:32:10 -08:00 committed by GitHub
parent 1bf74cca4a
commit 0b9423a0ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {
@ -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,
))
}
}