0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-10-28 22:27:49 -04: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)] #[repr(C)]
pub struct FastApiOneByteString { pub struct FastApiOneByteString {
data: *const u8, data: *const u8,
pub length: usize, pub length: u32,
} }
impl FastApiOneByteString { impl FastApiOneByteString {
@ -220,7 +220,7 @@ impl FastApiOneByteString {
unsafe { unsafe {
std::str::from_utf8_unchecked(std::slice::from_raw_parts( std::str::from_utf8_unchecked(std::slice::from_raw_parts(
self.data, self.data,
self.length, self.length as usize,
)) ))
} }
} }