Skip to content

Commit

Permalink
Put FontFace constructor to Immutable slice whitelist (#3072)
Browse files Browse the repository at this point in the history
* Put FontFace constructor to Immutable slice whitelist

* Update gen_FontFace.rs
  • Loading branch information
namse committed Sep 6, 2022
1 parent 5c28993 commit edc5adf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/web-sys/src/features/gen_FontFace.rs
Expand Up @@ -185,7 +185,7 @@ extern "C" {
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `FontFace`*"]
pub fn new_with_u8_array(family: &str, source: &mut [u8]) -> Result<FontFace, JsValue>;
pub fn new_with_u8_array(family: &str, source: &[u8]) -> Result<FontFace, JsValue>;
#[cfg(feature = "FontFaceDescriptors")]
#[wasm_bindgen(catch, constructor, js_class = "FontFace")]
#[doc = "The `new FontFace(..)` constructor, creating a new instance of `FontFace`."]
Expand Down Expand Up @@ -231,7 +231,7 @@ extern "C" {
#[doc = "*This API requires the following crate features to be activated: `FontFace`, `FontFaceDescriptors`*"]
pub fn new_with_u8_array_and_descriptors(
family: &str,
source: &mut [u8],
source: &[u8],
descriptors: &FontFaceDescriptors,
) -> Result<FontFace, JsValue>;
# [wasm_bindgen (catch , method , structural , js_class = "FontFace" , js_name = load)]
Expand Down
4 changes: 3 additions & 1 deletion crates/webidl/src/constants.rs
Expand Up @@ -87,6 +87,8 @@ pub(crate) static IMMUTABLE_SLICE_WHITELIST: Lazy<BTreeSet<&'static str>> = Lazy
"writeBuffer",
"writeTexture",
// AudioBuffer
"copyToChannel", // TODO: Add another type's functions here. Leave a comment header with the type name
"copyToChannel",
// FontFace
"FontFace", // TODO: Add another type's functions here. Leave a comment header with the type name
])
});

0 comments on commit edc5adf

Please sign in to comment.