Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 455cf46

Browse files
committedDec 25, 2024·
Use alloc::vec::Vec instead of Vec for no_std support
1 parent 130d2cf commit 455cf46

18 files changed

+54
-37
lines changed
 

‎crates/web-sys/src/features/gen_AudioBuffer.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,8 @@ extern "C" {
146146
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/getChannelData)"]
147147
#[doc = ""]
148148
#[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
149-
pub fn get_channel_data(this: &AudioBuffer, channel: u32) -> Result<Vec<f32>, JsValue>;
149+
pub fn get_channel_data(
150+
this: &AudioBuffer,
151+
channel: u32,
152+
) -> Result<::alloc::vec::Vec<f32>, JsValue>;
150153
}

‎crates/web-sys/src/features/gen_DomMatrixReadOnly.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -458,14 +458,14 @@ extern "C" {
458458
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly/toFloat32Array)"]
459459
#[doc = ""]
460460
#[doc = "*This API requires the following crate features to be activated: `DomMatrixReadOnly`*"]
461-
pub fn to_float32_array(this: &DomMatrixReadOnly) -> Result<Vec<f32>, JsValue>;
461+
pub fn to_float32_array(this: &DomMatrixReadOnly) -> Result<::alloc::vec::Vec<f32>, JsValue>;
462462
# [wasm_bindgen (catch , method , structural , js_class = "DOMMatrixReadOnly" , js_name = toFloat64Array)]
463463
#[doc = "The `toFloat64Array()` method."]
464464
#[doc = ""]
465465
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/DOMMatrixReadOnly/toFloat64Array)"]
466466
#[doc = ""]
467467
#[doc = "*This API requires the following crate features to be activated: `DomMatrixReadOnly`*"]
468-
pub fn to_float64_array(this: &DomMatrixReadOnly) -> Result<Vec<f64>, JsValue>;
468+
pub fn to_float64_array(this: &DomMatrixReadOnly) -> Result<::alloc::vec::Vec<f64>, JsValue>;
469469
# [wasm_bindgen (method , structural , js_class = "DOMMatrixReadOnly" , js_name = toJSON)]
470470
#[doc = "The `toJSON()` method."]
471471
#[doc = ""]

‎crates/web-sys/src/features/gen_FetchReadableStreamReadDataArray.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern "C" {
1414
#[doc = ""]
1515
#[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataArray`*"]
1616
#[wasm_bindgen(method, getter = "value")]
17-
pub fn get_value(this: &FetchReadableStreamReadDataArray) -> Option<Vec<u8>>;
17+
pub fn get_value(this: &FetchReadableStreamReadDataArray) -> Option<::alloc::vec::Vec<u8>>;
1818
#[doc = "Change the `value` field of this object."]
1919
#[doc = ""]
2020
#[doc = "*This API requires the following crate features to be activated: `FetchReadableStreamReadDataArray`*"]

‎crates/web-sys/src/features/gen_GamepadPose.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,44 @@ extern "C" {
3232
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/position)"]
3333
#[doc = ""]
3434
#[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"]
35-
pub fn position(this: &GamepadPose) -> Result<Option<Vec<f32>>, JsValue>;
35+
pub fn position(this: &GamepadPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
3636
# [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = linearVelocity)]
3737
#[doc = "Getter for the `linearVelocity` field of this object."]
3838
#[doc = ""]
3939
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/linearVelocity)"]
4040
#[doc = ""]
4141
#[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"]
42-
pub fn linear_velocity(this: &GamepadPose) -> Result<Option<Vec<f32>>, JsValue>;
42+
pub fn linear_velocity(this: &GamepadPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
4343
# [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = linearAcceleration)]
4444
#[doc = "Getter for the `linearAcceleration` field of this object."]
4545
#[doc = ""]
4646
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/linearAcceleration)"]
4747
#[doc = ""]
4848
#[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"]
49-
pub fn linear_acceleration(this: &GamepadPose) -> Result<Option<Vec<f32>>, JsValue>;
49+
pub fn linear_acceleration(
50+
this: &GamepadPose,
51+
) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
5052
# [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = orientation)]
5153
#[doc = "Getter for the `orientation` field of this object."]
5254
#[doc = ""]
5355
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/orientation)"]
5456
#[doc = ""]
5557
#[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"]
56-
pub fn orientation(this: &GamepadPose) -> Result<Option<Vec<f32>>, JsValue>;
58+
pub fn orientation(this: &GamepadPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
5759
# [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = angularVelocity)]
5860
#[doc = "Getter for the `angularVelocity` field of this object."]
5961
#[doc = ""]
6062
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/angularVelocity)"]
6163
#[doc = ""]
6264
#[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"]
63-
pub fn angular_velocity(this: &GamepadPose) -> Result<Option<Vec<f32>>, JsValue>;
65+
pub fn angular_velocity(this: &GamepadPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
6466
# [wasm_bindgen (structural , catch , method , getter , js_class = "GamepadPose" , js_name = angularAcceleration)]
6567
#[doc = "Getter for the `angularAcceleration` field of this object."]
6668
#[doc = ""]
6769
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GamepadPose/angularAcceleration)"]
6870
#[doc = ""]
6971
#[doc = "*This API requires the following crate features to be activated: `GamepadPose`*"]
70-
pub fn angular_acceleration(this: &GamepadPose) -> Result<Option<Vec<f32>>, JsValue>;
72+
pub fn angular_acceleration(
73+
this: &GamepadPose,
74+
) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
7175
}

‎crates/web-sys/src/features/gen_GamepadTouch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern "C" {
4848
#[doc = ""]
4949
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
5050
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51-
pub fn position(this: &GamepadTouch) -> Vec<f32>;
51+
pub fn position(this: &GamepadTouch) -> ::alloc::vec::Vec<f32>;
5252
#[cfg(web_sys_unstable_apis)]
5353
# [wasm_bindgen (structural , method , getter , js_class = "GamepadTouch" , js_name = surfaceDimensions)]
5454
#[doc = "Getter for the `surfaceDimensions` field of this object."]
@@ -59,5 +59,5 @@ extern "C" {
5959
#[doc = ""]
6060
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
6161
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
62-
pub fn surface_dimensions(this: &GamepadTouch) -> Option<Vec<u32>>;
62+
pub fn surface_dimensions(this: &GamepadTouch) -> Option<::alloc::vec::Vec<u32>>;
6363
}

‎crates/web-sys/src/features/gen_ImageData.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern "C" {
3232
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageData/data)"]
3333
#[doc = ""]
3434
#[doc = "*This API requires the following crate features to be activated: `ImageData`*"]
35-
pub fn data(this: &ImageData) -> ::wasm_bindgen::Clamped<Vec<u8>>;
35+
pub fn data(this: &ImageData) -> ::wasm_bindgen::Clamped<::alloc::vec::Vec<u8>>;
3636
#[wasm_bindgen(catch, constructor, js_class = "ImageData")]
3737
#[doc = "The `new ImageData(..)` constructor, creating a new instance of `ImageData`."]
3838
#[doc = ""]

‎crates/web-sys/src/features/gen_MidiMessageEvent.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MIDIMessageEvent/data)"]
1919
#[doc = ""]
2020
#[doc = "*This API requires the following crate features to be activated: `MidiMessageEvent`*"]
21-
pub fn data(this: &MidiMessageEvent) -> Result<Vec<u8>, JsValue>;
21+
pub fn data(this: &MidiMessageEvent) -> Result<::alloc::vec::Vec<u8>, JsValue>;
2222
#[wasm_bindgen(catch, constructor, js_class = "MIDIMessageEvent")]
2323
#[doc = "The `new MidiMessageEvent(..)` constructor, creating a new instance of `MidiMessageEvent`."]
2424
#[doc = ""]

‎crates/web-sys/src/features/gen_MidiMessageEventInit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extern "C" {
4444
#[doc = ""]
4545
#[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"]
4646
#[wasm_bindgen(method, getter = "data")]
47-
pub fn get_data(this: &MidiMessageEventInit) -> Option<Vec<u8>>;
47+
pub fn get_data(this: &MidiMessageEventInit) -> Option<::alloc::vec::Vec<u8>>;
4848
#[doc = "Change the `data` field of this object."]
4949
#[doc = ""]
5050
#[doc = "*This API requires the following crate features to be activated: `MidiMessageEventInit`*"]

‎crates/web-sys/src/features/gen_TextEncoder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ extern "C" {
3232
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode)"]
3333
#[doc = ""]
3434
#[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
35-
pub fn encode(this: &TextEncoder) -> Vec<u8>;
35+
pub fn encode(this: &TextEncoder) -> ::alloc::vec::Vec<u8>;
3636
# [wasm_bindgen (method , structural , js_class = "TextEncoder" , js_name = encode)]
3737
#[doc = "The `encode()` method."]
3838
#[doc = ""]
3939
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encode)"]
4040
#[doc = ""]
4141
#[doc = "*This API requires the following crate features to be activated: `TextEncoder`*"]
42-
pub fn encode_with_input(this: &TextEncoder, input: &str) -> Vec<u8>;
42+
pub fn encode_with_input(this: &TextEncoder, input: &str) -> ::alloc::vec::Vec<u8>;
4343
}

‎crates/web-sys/src/features/gen_VrEyeParameters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VREyeParameters/offset)"]
1919
#[doc = ""]
2020
#[doc = "*This API requires the following crate features to be activated: `VrEyeParameters`*"]
21-
pub fn offset(this: &VrEyeParameters) -> Result<Vec<f32>, JsValue>;
21+
pub fn offset(this: &VrEyeParameters) -> Result<::alloc::vec::Vec<f32>, JsValue>;
2222
#[cfg(feature = "VrFieldOfView")]
2323
# [wasm_bindgen (structural , method , getter , js_class = "VREyeParameters" , js_name = fieldOfView)]
2424
#[doc = "Getter for the `fieldOfView` field of this object."]

‎crates/web-sys/src/features/gen_VrFrameData.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,28 @@ extern "C" {
2525
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/leftProjectionMatrix)"]
2626
#[doc = ""]
2727
#[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"]
28-
pub fn left_projection_matrix(this: &VrFrameData) -> Result<Vec<f32>, JsValue>;
28+
pub fn left_projection_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec<f32>, JsValue>;
2929
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRFrameData" , js_name = leftViewMatrix)]
3030
#[doc = "Getter for the `leftViewMatrix` field of this object."]
3131
#[doc = ""]
3232
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/leftViewMatrix)"]
3333
#[doc = ""]
3434
#[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"]
35-
pub fn left_view_matrix(this: &VrFrameData) -> Result<Vec<f32>, JsValue>;
35+
pub fn left_view_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec<f32>, JsValue>;
3636
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRFrameData" , js_name = rightProjectionMatrix)]
3737
#[doc = "Getter for the `rightProjectionMatrix` field of this object."]
3838
#[doc = ""]
3939
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/rightProjectionMatrix)"]
4040
#[doc = ""]
4141
#[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"]
42-
pub fn right_projection_matrix(this: &VrFrameData) -> Result<Vec<f32>, JsValue>;
42+
pub fn right_projection_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec<f32>, JsValue>;
4343
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRFrameData" , js_name = rightViewMatrix)]
4444
#[doc = "Getter for the `rightViewMatrix` field of this object."]
4545
#[doc = ""]
4646
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRFrameData/rightViewMatrix)"]
4747
#[doc = ""]
4848
#[doc = "*This API requires the following crate features to be activated: `VrFrameData`*"]
49-
pub fn right_view_matrix(this: &VrFrameData) -> Result<Vec<f32>, JsValue>;
49+
pub fn right_view_matrix(this: &VrFrameData) -> Result<::alloc::vec::Vec<f32>, JsValue>;
5050
#[cfg(feature = "VrPose")]
5151
# [wasm_bindgen (structural , method , getter , js_class = "VRFrameData" , js_name = pose)]
5252
#[doc = "Getter for the `pose` field of this object."]

‎crates/web-sys/src/features/gen_VrPose.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,40 @@ extern "C" {
1818
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/position)"]
1919
#[doc = ""]
2020
#[doc = "*This API requires the following crate features to be activated: `VrPose`*"]
21-
pub fn position(this: &VrPose) -> Result<Option<Vec<f32>>, JsValue>;
21+
pub fn position(this: &VrPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
2222
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = linearVelocity)]
2323
#[doc = "Getter for the `linearVelocity` field of this object."]
2424
#[doc = ""]
2525
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/linearVelocity)"]
2626
#[doc = ""]
2727
#[doc = "*This API requires the following crate features to be activated: `VrPose`*"]
28-
pub fn linear_velocity(this: &VrPose) -> Result<Option<Vec<f32>>, JsValue>;
28+
pub fn linear_velocity(this: &VrPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
2929
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = linearAcceleration)]
3030
#[doc = "Getter for the `linearAcceleration` field of this object."]
3131
#[doc = ""]
3232
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/linearAcceleration)"]
3333
#[doc = ""]
3434
#[doc = "*This API requires the following crate features to be activated: `VrPose`*"]
35-
pub fn linear_acceleration(this: &VrPose) -> Result<Option<Vec<f32>>, JsValue>;
35+
pub fn linear_acceleration(this: &VrPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
3636
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = orientation)]
3737
#[doc = "Getter for the `orientation` field of this object."]
3838
#[doc = ""]
3939
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/orientation)"]
4040
#[doc = ""]
4141
#[doc = "*This API requires the following crate features to be activated: `VrPose`*"]
42-
pub fn orientation(this: &VrPose) -> Result<Option<Vec<f32>>, JsValue>;
42+
pub fn orientation(this: &VrPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
4343
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = angularVelocity)]
4444
#[doc = "Getter for the `angularVelocity` field of this object."]
4545
#[doc = ""]
4646
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/angularVelocity)"]
4747
#[doc = ""]
4848
#[doc = "*This API requires the following crate features to be activated: `VrPose`*"]
49-
pub fn angular_velocity(this: &VrPose) -> Result<Option<Vec<f32>>, JsValue>;
49+
pub fn angular_velocity(this: &VrPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
5050
# [wasm_bindgen (structural , catch , method , getter , js_class = "VRPose" , js_name = angularAcceleration)]
5151
#[doc = "Getter for the `angularAcceleration` field of this object."]
5252
#[doc = ""]
5353
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRPose/angularAcceleration)"]
5454
#[doc = ""]
5555
#[doc = "*This API requires the following crate features to be activated: `VrPose`*"]
56-
pub fn angular_acceleration(this: &VrPose) -> Result<Option<Vec<f32>>, JsValue>;
56+
pub fn angular_acceleration(this: &VrPose) -> Result<Option<::alloc::vec::Vec<f32>>, JsValue>;
5757
}

‎crates/web-sys/src/features/gen_VrStageParameters.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ extern "C" {
1818
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/VRStageParameters/sittingToStandingTransform)"]
1919
#[doc = ""]
2020
#[doc = "*This API requires the following crate features to be activated: `VrStageParameters`*"]
21-
pub fn sitting_to_standing_transform(this: &VrStageParameters) -> Result<Vec<f32>, JsValue>;
21+
pub fn sitting_to_standing_transform(
22+
this: &VrStageParameters,
23+
) -> Result<::alloc::vec::Vec<f32>, JsValue>;
2224
# [wasm_bindgen (structural , method , getter , js_class = "VRStageParameters" , js_name = sizeX)]
2325
#[doc = "Getter for the `sizeX` field of this object."]
2426
#[doc = ""]

‎crates/web-sys/src/features/gen_WaveShaperNode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WaveShaperNode/curve)"]
1919
#[doc = ""]
2020
#[doc = "*This API requires the following crate features to be activated: `WaveShaperNode`*"]
21-
pub fn curve(this: &WaveShaperNode) -> Option<Vec<f32>>;
21+
pub fn curve(this: &WaveShaperNode) -> Option<::alloc::vec::Vec<f32>>;
2222
# [wasm_bindgen (structural , method , setter , js_class = "WaveShaperNode" , js_name = curve)]
2323
#[doc = "Setter for the `curve` field of this object."]
2424
#[doc = ""]

‎crates/web-sys/src/features/gen_XrRigidTransform.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050
#[doc = ""]
5151
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
5252
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53-
pub fn matrix(this: &XrRigidTransform) -> Vec<f32>;
53+
pub fn matrix(this: &XrRigidTransform) -> ::alloc::vec::Vec<f32>;
5454
#[cfg(web_sys_unstable_apis)]
5555
# [wasm_bindgen (structural , method , getter , js_class = "XRRigidTransform" , js_name = inverse)]
5656
#[doc = "Getter for the `inverse` field of this object."]

‎crates/web-sys/src/features/gen_XrSession.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extern "C" {
4949
#[doc = ""]
5050
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
5151
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
52-
pub fn supported_frame_rates(this: &XrSession) -> Option<Vec<f32>>;
52+
pub fn supported_frame_rates(this: &XrSession) -> Option<::alloc::vec::Vec<f32>>;
5353
#[cfg(web_sys_unstable_apis)]
5454
#[cfg(feature = "XrRenderState")]
5555
# [wasm_bindgen (structural , method , getter , js_class = "XRSession" , js_name = renderState)]

‎crates/web-sys/src/features/gen_XrView.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern "C" {
3838
#[doc = ""]
3939
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
4040
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
41-
pub fn projection_matrix(this: &XrView) -> Vec<f32>;
41+
pub fn projection_matrix(this: &XrView) -> ::alloc::vec::Vec<f32>;
4242
#[cfg(web_sys_unstable_apis)]
4343
#[cfg(feature = "XrRigidTransform")]
4444
# [wasm_bindgen (structural , method , getter , js_class = "XRView" , js_name = transform)]

‎crates/webidl/src/util.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::ptr;
77
use heck::{ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase};
88
use proc_macro2::{Ident, TokenStream};
99
use quote::quote;
10+
use syn::punctuated::Punctuated;
1011
use wasm_bindgen_backend::util::{ident_ty, raw_ident, rust_ident};
1112
use weedle::attribute::{
1213
ExtendedAttribute, ExtendedAttributeIdent, ExtendedAttributeList, ExtendedAttributeNoArgs,
@@ -177,7 +178,7 @@ pub(crate) fn slice_ty(t: syn::Type) -> syn::Type {
177178
.into()
178179
}
179180

180-
/// From `T` create `Vec<T>`.
181+
/// From `T` create `alloc::Vec<T>`.
181182
pub(crate) fn vec_ty(t: syn::Type) -> syn::Type {
182183
let arguments = syn::PathArguments::AngleBracketed(syn::AngleBracketedGenericArguments {
183184
colon2_token: None,
@@ -186,9 +187,16 @@ pub(crate) fn vec_ty(t: syn::Type) -> syn::Type {
186187
gt_token: Default::default(),
187188
});
188189

189-
let ident = raw_ident("Vec");
190-
let seg = syn::PathSegment { ident, arguments };
191-
let path: syn::Path = seg.into();
190+
let mut path = syn::Path {
191+
leading_colon: Some(Default::default()),
192+
segments: Punctuated::new(),
193+
};
194+
path.segments.push(raw_ident("alloc").into());
195+
path.segments.push(raw_ident("vec").into());
196+
path.segments.push(syn::PathSegment {
197+
ident: raw_ident("Vec"),
198+
arguments,
199+
});
192200
let ty = syn::TypePath { qself: None, path };
193201
ty.into()
194202
}

0 commit comments

Comments
 (0)
Please sign in to comment.