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:
parent
1bf74cca4a
commit
0b9423a0ee
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue