mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-28 07:51:07 +00:00
Clarify nightly-ness of Closure::new
`Closure` itself does not require nightly, only the `new` function.
This commit is contained in:
parent
1ee579093b
commit
f230e66242
@ -3,8 +3,6 @@
|
|||||||
//! This module defines the `Closure` type which is used to pass "owned
|
//! This module defines the `Closure` type which is used to pass "owned
|
||||||
//! closures" from Rust to JS. Some more details can be found on the `Closure`
|
//! closures" from Rust to JS. Some more details can be found on the `Closure`
|
||||||
//! type itself.
|
//! type itself.
|
||||||
//!
|
|
||||||
//! The `nightly` feature is required for the `Closure` type to be used.
|
|
||||||
|
|
||||||
use std::cell::UnsafeCell;
|
use std::cell::UnsafeCell;
|
||||||
#[cfg(feature = "nightly")]
|
#[cfg(feature = "nightly")]
|
||||||
@ -89,6 +87,10 @@ impl<T> Closure<T>
|
|||||||
///
|
///
|
||||||
/// This is unfortunately pretty restrictive for now but hopefully some of
|
/// This is unfortunately pretty restrictive for now but hopefully some of
|
||||||
/// these restrictions can be lifted in the future!
|
/// these restrictions can be lifted in the future!
|
||||||
|
///
|
||||||
|
/// *This method requires the `nightly` feature of the `wasm-bindgen` crate
|
||||||
|
/// to be enabled, meaning this is a nightly-only API. Users on stable
|
||||||
|
/// should use `Closure::wrap`.*
|
||||||
#[cfg(feature = "nightly")]
|
#[cfg(feature = "nightly")]
|
||||||
pub fn new<F>(t: F) -> Closure<T>
|
pub fn new<F>(t: F) -> Closure<T>
|
||||||
where F: Unsize<T> + 'static
|
where F: Unsize<T> + 'static
|
||||||
|
Loading…
x
Reference in New Issue
Block a user